@momo-kits/foundation 0.92.26 → 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.
@@ -19,7 +19,6 @@ import {Icon} from '../Icon';
19
19
 
20
20
  const BottomSheet: React.FC<BottomSheetParams> = props => {
21
21
  const {theme, navigator} = useContext(ApplicationContext);
22
- const closed = useRef(false);
23
22
  const heightDevice = Dimensions.get('screen').height;
24
23
  const insets = useSafeAreaInsets();
25
24
  const {
@@ -75,12 +74,9 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
75
74
  Animated.timing(pan, {
76
75
  toValue: {x: 0, y: 0},
77
76
  useNativeDriver: false,
78
- duration: 150,
77
+ duration: 200,
79
78
  }).start();
80
79
  return () => {
81
- if (!closed.current) {
82
- navigator?.pop();
83
- }
84
80
  props.route.params?.onDismiss?.();
85
81
  };
86
82
  }, []);
@@ -92,22 +88,20 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
92
88
  if (barrierDismissible && !force) {
93
89
  return;
94
90
  }
95
- setTimeout(() => {
96
- closed.current = true;
97
- navigator?.pop();
98
- callback?.();
99
- }, 350);
100
91
  Animated.timing(pan, {
101
92
  toValue: {x: 0, y: heightDevice},
102
93
  useNativeDriver: false,
103
94
  duration: 200,
104
- }).start();
95
+ }).start(() => {
96
+ navigator?.pop();
97
+ callback?.();
98
+ });
105
99
  };
106
100
 
107
101
  /**
108
102
  * manual close
109
103
  */
110
- const requestClose = useCallback((callback?: () => void) => {
104
+ const onRequestClose = useCallback((callback?: () => void) => {
111
105
  onDismiss(true, callback);
112
106
  }, []);
113
107
 
@@ -168,7 +162,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
168
162
  <Screen
169
163
  {...props}
170
164
  {...props.route.params}
171
- requestClose={requestClose}
165
+ onRequestClose={onRequestClose}
172
166
  />
173
167
  {useBottomInset && (
174
168
  <View style={{height: Math.min(insets.bottom, 21)}} />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.92.26",
3
+ "version": "0.92.27",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},