@momo-kits/foundation 0.92.24 → 0.92.26-beta.0

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,6 +19,7 @@ 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);
22
23
  const heightDevice = Dimensions.get('screen').height;
23
24
  const insets = useSafeAreaInsets();
24
25
  const {
@@ -74,9 +75,12 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
74
75
  Animated.timing(pan, {
75
76
  toValue: {x: 0, y: 0},
76
77
  useNativeDriver: false,
77
- duration: 150,
78
+ duration: 200,
78
79
  }).start();
79
80
  return () => {
81
+ if (!closed.current) {
82
+ navigator?.pop();
83
+ }
80
84
  props.route.params?.onDismiss?.();
81
85
  };
82
86
  }, []);
@@ -88,17 +92,16 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
88
92
  if (barrierDismissible && !force) {
89
93
  return;
90
94
  }
95
+ closed.current = true;
91
96
  setTimeout(() => {
97
+ navigator?.pop();
92
98
  callback?.();
93
- }, 350);
94
-
99
+ }, 300);
95
100
  Animated.timing(pan, {
96
101
  toValue: {x: 0, y: heightDevice},
97
102
  useNativeDriver: false,
98
- duration: 100,
99
- }).start(() => {
100
- navigator?.pop();
101
- });
103
+ duration: 200,
104
+ }).start();
102
105
  };
103
106
 
104
107
  /**
@@ -165,7 +168,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
165
168
  <Screen
166
169
  {...props}
167
170
  {...props.route.params}
168
- requestClose={requestClose}
171
+ // requestClose={requestClose}
169
172
  />
170
173
  {useBottomInset && (
171
174
  <View style={{height: Math.min(insets.bottom, 21)}} />
@@ -20,7 +20,7 @@ const ItemList = forwardRef(
20
20
  contentContainerStyle,
21
21
  ...props
22
22
  }: ItemListProps,
23
- ref,
23
+ ref
24
24
  ) => {
25
25
  const {gutterSize, numberOfColumns} = useContext(GridContext);
26
26
  const widthItem = (widthSpan ?? numberOfColumns) as SpanNumber;
@@ -41,6 +41,7 @@ const ItemList = forwardRef(
41
41
  <FlatList
42
42
  ref={ref as React.RefObject<FlatList>}
43
43
  {...props}
44
+ key={`ItemList-${numColumns}`}
44
45
  numColumns={numColumns}
45
46
  renderItem={_renderItem}
46
47
  horizontal={false}
@@ -49,7 +50,7 @@ const ItemList = forwardRef(
49
50
  contentContainerStyle={[contentContainerStyle, styles.protectedStyle]}
50
51
  />
51
52
  );
52
- },
53
+ }
53
54
  );
54
55
 
55
56
  export default ItemList;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.92.24",
3
+ "version": "0.92.26-beta.0",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},
@@ -43,4 +43,4 @@
43
43
  },
44
44
  "author": "@momo-kits/foundation",
45
45
  "license": "ISC"
46
- }
46
+ }
package/publish.sh CHANGED
@@ -7,16 +7,16 @@ rsync -r --exclude=/dist ./* dist
7
7
  cd dist
8
8
 
9
9
  if [ "$1" == "stable" ]; then
10
- npm version $(npm view @momo-kits/foundation@stable version)
11
- npm version patch
10
+ #npm version $(npm view @momo-kits/foundation@stable version)
11
+ #npm version patch
12
12
  npm publish --tag stable --access=public
13
13
  elif [ "$1" == "latest" ]; then
14
- npm version $(npm view @momo-kits/foundation@latest version)
15
- npm version prerelease --preid=rc
14
+ #npm version $(npm view @momo-kits/foundation@latest version)
15
+ #npm version prerelease --preid=rc
16
16
  npm publish --tag latest --access=public
17
17
  else
18
- npm version $(npm view @momo-kits/foundation@beta version)
19
- npm version prerelease --preid=beta
18
+ #npm version $(npm view @momo-kits/foundation@beta version)
19
+ #npm version prerelease --preid=beta
20
20
  npm publish --tag beta --access=public
21
21
  fi
22
22