From 427af5196e4a078f60ed8d6c42ae62ad93a0301f Mon Sep 17 00:00:00 2001 From: Dominic Go Date: Sat, 28 Sep 2024 07:04:48 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=81=20Cleanup:=20`RNIModalSheetViewDel?= =?UTF-8?q?egate`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RNIModalSheetViewDelegate.swift | 20 ++++--------------- .../ModalSheetView/ModalSheetView.tsx | 4 +--- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/ios/RNIModalSheetView/RNIModalSheetViewDelegate.swift b/ios/RNIModalSheetView/RNIModalSheetViewDelegate.swift index 5913821d..a5ce7ca8 100644 --- a/ios/RNIModalSheetView/RNIModalSheetViewDelegate.swift +++ b/ios/RNIModalSheetView/RNIModalSheetViewDelegate.swift @@ -25,9 +25,9 @@ public final class RNIModalSheetViewDelegate: UIView, RNIContentView { case onModalDidHide; }; - public enum Events: String, CaseIterable { - case placeholderEvent; - } + public static var propKeyPathMap: PropKeyPathMap { + return [:]; + }; // MARK: Properties // ---------------- @@ -120,21 +120,9 @@ extension RNIModalSheetViewDelegate: RNIContentViewDelegate { index: NSInteger, superBlock: () -> Void ) { - // no-op + childComponentView.removeFromSuperview(); } - public func notifyDidSetProps(sender: RNIContentViewParentDelegate) { - // no-op - }; - - public func notifyOnUpdateLayoutMetrics( - sender: RNIContentViewParentDelegate, - oldLayoutMetrics: RNILayoutMetrics, - newLayoutMetrics: RNILayoutMetrics - ) { - // no-op - }; - public func notifyOnViewCommandRequest( sender: RNIContentViewParentDelegate, forCommandName commandName: String, diff --git a/src/components/ModalSheetView/ModalSheetView.tsx b/src/components/ModalSheetView/ModalSheetView.tsx index 203abedf..5ad5fd6b 100644 --- a/src/components/ModalSheetView/ModalSheetView.tsx +++ b/src/components/ModalSheetView/ModalSheetView.tsx @@ -36,7 +36,6 @@ export const ModalSheetView = React.forwardRef< setModalSheetContentMap ] = React.useState({}); - const isModalContentLazy = props.isModalContentLazy ?? true; const shouldMountModalContents = @@ -91,8 +90,6 @@ export const ModalSheetView = React.forwardRef< const shouldEnableDebugBackgroundColors = props.shouldEnableDebugBackgroundColors ?? false; - - const children = React.Children.map(props.children, (child) => { return React.cloneElement( child as React.ReactElement, @@ -105,6 +102,7 @@ export const ModalSheetView = React.forwardRef< return ( nativeRef.current = ref} style={styles.nativeModalSheet} >