Skip to content

Commit

Permalink
🛠 Refactor: Update RNIModalManager
Browse files Browse the repository at this point in the history
Related:
* `TODO:2023-03-24-09-56-09` - Remove temporary changes to `RNIModalManager`.
  • Loading branch information
dominicstop committed Mar 26, 2023
1 parent 17a207f commit 9684859
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 29 deletions.
15 changes: 2 additions & 13 deletions ios/src_library/React Native/RNIModal/RNIModal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@

import Foundation

/// TODO:2023-03-24-09-56-09 - Remove temporary changes to `RNIModalManager`.
///
/// A collection of protocols that the "adoptee" needs to implement in order to
/// be considered a "modal".
///
public typealias RNIModal =
RNIModalIdentity
& RNIModalState
// & RNIModalRequestable
// & RNIModalFocusNotifiable
& RNIModalRequestable
& RNIModalFocusNotifiable
& RNIModalFocusNotifying
& RNIModalPresentation;

Expand Down Expand Up @@ -84,15 +82,6 @@ public protocol RNIModalRequestable: AnyObject {
/// modal "focus/blur"-related notifications.
///
public protocol RNIModalFocusNotifiable {

// func onModalWillFocusNotification(sender modal: RNIModal);
//
// func onModalDidFocusNotification(sender modal: RNIModal);
//
// func onModalWillBlurNotification(sender modal: RNIModal);
//
// func onModalDidBlurNotification(sender modal: RNIModal);

func onModalWillFocusNotification(sender modal: RNIModal);

func onModalDidFocusNotification(sender modal: RNIModal);
Expand Down
20 changes: 4 additions & 16 deletions ios/src_library/React Native/RNIModal/RNIModalManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,7 @@ extension RNIModalManager: RNIModalFocusNotifiable {
guard modalItem.modalNativeID != modal.modalNativeID
else { continue };

/// TODO:2023-03-24-09-56-09 - Remove temporary changes to `RNIModalManager`.
// modalItem.onModalWillFocusNotification(sender: modal);
(modalItem as? RNIModalFocusNotifiable)?
.onModalWillFocusNotification(sender: modal);
modalItem.onModalWillFocusNotification(sender: modal);
};
};

Expand All @@ -212,10 +209,7 @@ extension RNIModalManager: RNIModalFocusNotifiable {
guard modalItem.modalNativeID != modal.modalNativeID
else { continue };

/// TODO:2023-03-24-09-56-09 - Remove temporary changes to `RNIModalManager`.
// modalItem.onModalDidFocusNotification(sender: modal);
(modalItem as? RNIModalFocusNotifiable)?
.onModalDidFocusNotification(sender: modal);
modalItem.onModalDidFocusNotification(sender: modal);
};
};

Expand All @@ -228,10 +222,7 @@ extension RNIModalManager: RNIModalFocusNotifiable {
guard modalItem.modalNativeID != modal.modalNativeID
else { continue };

/// TODO:2023-03-24-09-56-09 - Remove temporary changes to `RNIModalManager`.
// modalItem.onModalWillBlurNotification(sender: modal);
(modalItem as? RNIModalFocusNotifiable)?
.onModalWillBlurNotification(sender: modal);
modalItem.onModalWillBlurNotification(sender: modal);
};
};

Expand All @@ -244,10 +235,7 @@ extension RNIModalManager: RNIModalFocusNotifiable {
guard modalItem.modalNativeID != modal.modalNativeID
else { continue };

/// TODO:2023-03-24-09-56-09 - Remove temporary changes to `RNIModalManager`.
// modalItem.onModalDidBlurNotification(sender: modal);
(modalItem as? RNIModalFocusNotifiable)?
.onModalDidBlurNotification(sender: modal);
modalItem.onModalDidBlurNotification(sender: modal);
};
};
};

0 comments on commit 9684859

Please sign in to comment.