@momo-kits/foundation 0.92.26-beta.6 → 0.92.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -88,22 +88,20 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
88
88
|
if (barrierDismissible && !force) {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
setTimeout(() => {
|
|
92
|
-
callback?.();
|
|
93
|
-
}, 300);
|
|
94
91
|
Animated.timing(pan, {
|
|
95
92
|
toValue: {x: 0, y: heightDevice},
|
|
96
93
|
useNativeDriver: false,
|
|
97
94
|
duration: 200,
|
|
98
95
|
}).start(() => {
|
|
99
96
|
navigator?.pop();
|
|
97
|
+
callback?.();
|
|
100
98
|
});
|
|
101
99
|
};
|
|
102
100
|
|
|
103
101
|
/**
|
|
104
102
|
* manual close
|
|
105
103
|
*/
|
|
106
|
-
const
|
|
104
|
+
const onRequestClose = useCallback((callback?: () => void) => {
|
|
107
105
|
onDismiss(true, callback);
|
|
108
106
|
}, []);
|
|
109
107
|
|
|
@@ -161,7 +159,11 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
161
159
|
<Animated.View style={{transform: pan.getTranslateTransform()}}>
|
|
162
160
|
{renderHeader()}
|
|
163
161
|
<View style={{backgroundColor: backgroundColor}}>
|
|
164
|
-
<Screen
|
|
162
|
+
<Screen
|
|
163
|
+
{...props}
|
|
164
|
+
{...props.route.params}
|
|
165
|
+
onRequestClose={onRequestClose}
|
|
166
|
+
/>
|
|
165
167
|
{useBottomInset && (
|
|
166
168
|
<View style={{height: Math.min(insets.bottom, 21)}} />
|
|
167
169
|
)}
|