@momo-kits/foundation 0.110.1-optimize.4 → 0.110.1-optimize.6

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.
@@ -30,6 +30,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
30
30
  barrierDismissible = false,
31
31
  draggable = true,
32
32
  useBottomInset = true,
33
+ useKeyboardAvoidingView = true,
33
34
  keyboardVerticalOffset,
34
35
  }: BottomSheetParams = props.route.params;
35
36
  const pan = useRef(
@@ -172,8 +173,12 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
172
173
  }}
173
174
  style={styles.overlay}>
174
175
  <KeyboardAvoidingView
175
- behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
176
+ behavior={Platform.select({
177
+ ios: 'padding',
178
+ android: undefined,
179
+ })}
176
180
  keyboardVerticalOffset={keyboardVerticalOffset ?? -20}
181
+ enabled={useKeyboardAvoidingView}
177
182
  style={[Styles.flex, {justifyContent: 'flex-end'}]}>
178
183
  <TouchableOpacity
179
184
  style={Styles.flex}
@@ -17,15 +17,6 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
17
17
  const context = useContext<any>(MiniAppContext);
18
18
  const {navigator} = useContext(ApplicationContext);
19
19
 
20
- useEffect(() => {
21
- const backHandler = BackHandler.addEventListener(
22
- 'hardwareBackPress',
23
- goBackSafe
24
- );
25
-
26
- return () => backHandler.remove();
27
- }, []);
28
-
29
20
  const goBackSafe = () => {
30
21
  const goBack = () => {
31
22
  const canGoBack = navigator?.ref?.current?.canGoBack?.();
@@ -72,6 +63,15 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
72
63
  return true;
73
64
  };
74
65
 
66
+ useEffect(() => {
67
+ const backHandler = BackHandler.addEventListener(
68
+ 'hardwareBackPress',
69
+ goBackSafe
70
+ );
71
+
72
+ return () => backHandler.remove();
73
+ }, [goBackSafe]);
74
+
75
75
  return (
76
76
  <View style={styles.headerLeft}>
77
77
  <NavigationButton
@@ -207,7 +207,7 @@ const StackScreen: React.FC<ScreenParams> = props => {
207
207
  /**
208
208
  * for stop tracking when user interaction
209
209
  */
210
- if (data.interaction) {
210
+ if (data?.interaction) {
211
211
  onScreenLoad();
212
212
  onScreenInteraction();
213
213
  }
@@ -137,6 +137,7 @@ export type BottomSheetParams = {
137
137
  barrierDismissible?: boolean;
138
138
  draggable?: boolean;
139
139
  useBottomInset?: boolean;
140
+ useKeyboardAvoidingView?: boolean;
140
141
  keyboardVerticalOffset?: number;
141
142
  };
142
143
 
package/Input/styles.ts CHANGED
@@ -123,6 +123,7 @@ export default StyleSheet.create({
123
123
  textButton: {marginLeft: Spacing.L},
124
124
  divider: {
125
125
  width: 1,
126
+ height: 20,
126
127
  marginLeft: Spacing.XS,
127
128
  },
128
129
  moneyInput: {
package/Text/index.tsx CHANGED
@@ -176,16 +176,19 @@ const exportFontFamily = (
176
176
  let newFontFamily;
177
177
 
178
178
  switch (fontWeight) {
179
- case 'bold': {
179
+ case 'bold':
180
+ case 'Bold':
180
181
  typography = 'action_xs_bold';
181
182
  break;
182
- }
183
- case 'regular': {
183
+
184
+ case 'regular':
185
+ case 'Regular':
184
186
  typography = 'body_default_regular';
185
187
  break;
186
- }
188
+
187
189
  default: {
188
190
  typography = 'body_default_regular';
191
+ break;
189
192
  }
190
193
  }
191
194
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.110.1-optimize.4",
3
+ "version": "0.110.1-optimize.6",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},