@momo-kits/foundation 0.112.1-rn76.7 → 0.112.1-testing.20

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.
@@ -16,7 +16,7 @@ import {BottomSheetParams} from './types';
16
16
  import {Colors, Radius, Spacing, Styles} from '../Consts';
17
17
  import {Text} from '../Text';
18
18
  import {Icon} from '../Icon';
19
- import {useHeaderHeight} from '@react-navigation/elements';
19
+ import {useHeaderHeight} from '@react-navigation/stack';
20
20
  import Animated, {Easing, Extrapolate} from 'react-native-reanimated';
21
21
 
22
22
  const BottomSheet: React.FC<BottomSheetParams> = props => {
@@ -82,7 +82,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
82
82
  }).start();
83
83
  }
84
84
  },
85
- }),
85
+ })
86
86
  ).current;
87
87
 
88
88
  let Container: any = View;
@@ -1,11 +1,7 @@
1
1
  import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
2
- import {
3
- NavigationContainer,
4
- NavigationIndependentTree,
5
- useFocusEffect,
6
- } from '@react-navigation/native';
2
+ import {NavigationContainer, useFocusEffect} from '@react-navigation/native';
7
3
  import {createStackNavigator} from '@react-navigation/stack';
8
- import React, {useContext, useEffect, useRef} from 'react';
4
+ import React, {useContext, useEffect} from 'react';
9
5
  import {Animated, Platform, StatusBar} from 'react-native';
10
6
  import {useSafeAreaInsets} from 'react-native-safe-area-context';
11
7
  import {Colors} from '../../Consts';
@@ -15,7 +11,7 @@ import {ApplicationContext} from '../index';
15
11
  import StackScreen from '../StackScreen';
16
12
  import {BottomTabProps} from '../types';
17
13
  import {getOptions, getStackOptions} from '../utils';
18
- // import BottomTabBar from './BottomTabBar';
14
+ import BottomTabBar from './BottomTabBar';
19
15
 
20
16
  const Tab = createBottomTabNavigator();
21
17
  const Stack = createStackNavigator();
@@ -25,19 +21,18 @@ const TabScreen: React.FC<any> = ({route, navigation}) => {
25
21
 
26
22
  const opacityValue = 0.3;
27
23
  const scaleValue = 0.97;
28
-
29
- const opacity = useRef(new Animated.Value(opacityValue));
30
- const scale = useRef(new Animated.Value(scaleValue));
24
+ const opacity = new Animated.Value(opacityValue);
25
+ const scale = new Animated.Value(scaleValue);
31
26
 
32
27
  useFocusEffect(
33
28
  React.useCallback(() => {
34
29
  Animated.parallel([
35
- Animated.timing(opacity.current, {
30
+ Animated.timing(opacity, {
36
31
  toValue: 1,
37
32
  duration: 200,
38
33
  useNativeDriver: true,
39
34
  }),
40
- Animated.timing(scale.current, {
35
+ Animated.timing(scale, {
41
36
  toValue: 1,
42
37
  duration: 200,
43
38
  useNativeDriver: true,
@@ -46,12 +41,12 @@ const TabScreen: React.FC<any> = ({route, navigation}) => {
46
41
  return () => {
47
42
  if (navigation.getState().index !== route?.params.index) {
48
43
  Animated.parallel([
49
- Animated.timing(opacity.current, {
44
+ Animated.timing(opacity, {
50
45
  toValue: opacityValue,
51
46
  duration: 200,
52
47
  useNativeDriver: true,
53
48
  }),
54
- Animated.timing(scale.current, {
49
+ Animated.timing(scale, {
55
50
  toValue: scaleValue,
56
51
  duration: 200,
57
52
  useNativeDriver: true,
@@ -59,7 +54,7 @@ const TabScreen: React.FC<any> = ({route, navigation}) => {
59
54
  ]).start();
60
55
  }
61
56
  };
62
- }, [navigation, route?.params.index]),
57
+ }, [navigation])
63
58
  );
64
59
 
65
60
  let stackOptions = {};
@@ -69,12 +64,7 @@ const TabScreen: React.FC<any> = ({route, navigation}) => {
69
64
 
70
65
  if (nested) {
71
66
  return (
72
- <Animated.View
73
- style={{
74
- flex: 1,
75
- opacity: opacity.current,
76
- transform: [{scale: scale.current}],
77
- }}>
67
+ <Animated.View style={{flex: 1, opacity, transform: [{scale}]}}>
78
68
  <Stack.Navigator>
79
69
  <Stack.Screen
80
70
  name="Stack"
@@ -92,28 +82,21 @@ const TabScreen: React.FC<any> = ({route, navigation}) => {
92
82
  }
93
83
 
94
84
  return (
95
- <Animated.View
96
- style={{
97
- flex: 1,
98
- opacity: opacity.current,
99
- transform: [{scale: scale.current}],
100
- }}>
101
- <NavigationIndependentTree>
102
- <NavigationContainer>
103
- <Stack.Navigator>
104
- <Stack.Screen
105
- name="Stack"
106
- component={StackScreen}
107
- initialParams={{
108
- screen,
109
- options: stackOptions,
110
- initialParams,
111
- }}
112
- options={{...getStackOptions(), ...options}}
113
- />
114
- </Stack.Navigator>
115
- </NavigationContainer>
116
- </NavigationIndependentTree>
85
+ <Animated.View style={{flex: 1, opacity, transform: [{scale}]}}>
86
+ <NavigationContainer independent={true}>
87
+ <Stack.Navigator>
88
+ <Stack.Screen
89
+ name="Stack"
90
+ component={StackScreen}
91
+ initialParams={{
92
+ screen,
93
+ options: stackOptions,
94
+ initialParams,
95
+ }}
96
+ options={{...getStackOptions(), ...options}}
97
+ />
98
+ </Stack.Navigator>
99
+ </NavigationContainer>
117
100
  </Animated.View>
118
101
  );
119
102
  };
@@ -135,7 +118,7 @@ const BottomTab: React.FC<BottomTabProps> = ({
135
118
  headerTransparent: true,
136
119
  headerBackground: undefined,
137
120
  });
138
- }, [navigation]);
121
+ }, []);
139
122
 
140
123
  const handler: {
141
124
  tabPress?: (e: any) => void;
@@ -159,13 +142,13 @@ const BottomTab: React.FC<BottomTabProps> = ({
159
142
  <Tab.Navigator
160
143
  initialRouteName={initialRouteName}
161
144
  backBehavior={'firstRoute'}
162
- // tabBar={props => (
163
- // <BottomTabBar
164
- // {...props}
165
- // floatingButton={floatingButton}
166
- // inactiveTintColor={theme.colors.text.hint}
167
- // />
168
- // )}
145
+ tabBar={props => (
146
+ <BottomTabBar
147
+ {...props}
148
+ floatingButton={floatingButton}
149
+ inactiveTintColor={theme.colors.text.hint}
150
+ />
151
+ )}
169
152
  tabBarOptions={{
170
153
  style: {
171
154
  height: 64 + Math.min(insets.bottom, 21),
@@ -1,10 +1,8 @@
1
1
  import React, {useContext, useEffect, useRef, useState} from 'react';
2
- import type {NavigationState} from '@react-navigation/routers';
3
2
  import {SafeAreaProvider} from 'react-native-safe-area-context';
4
3
  import {
5
4
  NavigationContainer as ReactNavigationContainer,
6
5
  NavigationContainerRef,
7
- NavigationIndependentTree,
8
6
  } from '@react-navigation/native';
9
7
  import {
10
8
  createStackNavigator,
@@ -18,7 +16,7 @@ import {getDialogOptions, getModalOptions, getStackOptions} from './utils';
18
16
  import {NavigationContainerProps} from './types';
19
17
  import {ApplicationContext, MiniAppContext} from './index';
20
18
  import Localize from './Localize';
21
- import {Configs, defaultTheme} from '../Consts';
19
+ import {defaultTheme, Configs} from '../Consts';
22
20
 
23
21
  const Stack = createStackNavigator();
24
22
 
@@ -31,7 +29,7 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
31
29
  localize = new Localize({vi: {}, en: {}}),
32
30
  }) => {
33
31
  const context = useContext<any>(MiniAppContext);
34
- const navigationRef = useRef<NavigationContainerRef<any>>(null);
32
+ const navigationRef = useRef<NavigationContainerRef>(null);
35
33
  const routes = useRef<any>();
36
34
  const isReady = useRef(false);
37
35
  const navigator = useRef(new Navigator(navigationRef, isReady));
@@ -52,7 +50,7 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
52
50
  'onChangeGrid',
53
51
  enable => {
54
52
  setShowGrid(!!enable);
55
- },
53
+ }
56
54
  );
57
55
 
58
56
  return () => {
@@ -60,10 +58,6 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
60
58
  };
61
59
  }, []);
62
60
 
63
- /**
64
- * translate context method
65
- * @param data
66
- */
67
61
  const translate = (data?: string | {vi: string; en: string}) => {
68
62
  if (data && typeof data !== 'string') {
69
63
  return localize?.translateData(data);
@@ -80,7 +74,7 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
80
74
  const onScreenNavigated = (
81
75
  preScreenName: string,
82
76
  screenName: string,
83
- action: string,
77
+ action: string
84
78
  ) => {
85
79
  console.log(preScreenName, screenName, action);
86
80
  context?.autoTracking?.({
@@ -92,6 +86,9 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
92
86
  action,
93
87
  });
94
88
 
89
+ /**
90
+ * debug toast
91
+ */
95
92
  maxApi?.showToastDebug?.({
96
93
  appId: context.appId,
97
94
  message: `${screenName} screen_navigated`,
@@ -99,46 +96,11 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
99
96
  });
100
97
  };
101
98
 
102
- /**
103
- * onStateChange
104
- * @param state
105
- */
106
- const onStateChange = (state: Readonly<NavigationState> | undefined) => {
107
- const lastedRoute: any = state?.routes?.[state?.routes?.length - 1];
108
- const oldRoute: any = routes.current?.[routes.current?.length - 1];
109
- const lasted = lastedRoute?.params?.screen;
110
- const previous = oldRoute?.params?.screen;
111
- const preScreenName = previous?.name ?? previous?.type?.name;
112
- const screenName = lasted?.name ?? lasted?.type?.name;
113
-
114
- let action = 'push';
115
- if (routes.current?.length > (state?.routes?.length ?? 0)) {
116
- action = 'back';
117
- }
118
- onScreenNavigated(preScreenName, screenName, action);
119
- maxApi?.setObserver('CURRENT_SCREEN', {screenName});
120
- routes.current = state?.routes;
121
- };
122
-
123
- /**
124
- * onReady
125
- */
126
- const onReady = () => {
127
- isReady.current = true;
128
- routes.current = navigationRef.current?.getRootState?.()?.routes;
129
- maxApi?.getDataObserver('CURRENT_SCREEN', (data: any) => {
130
- onScreenNavigated(data?.screenName, screen?.name, 'push');
131
- maxApi?.setObserver('CURRENT_SCREEN', {
132
- screenName: screen?.name,
133
- });
134
- });
135
- };
136
-
137
- navigator.current.setCurrentContext = setCurrentContext;
138
-
139
99
  const headerBackground = theme.assets?.headerBackground || Configs.headerBar;
140
100
  const headerGradient = Configs?.headerGradient || theme.colors?.gradient;
141
101
 
102
+ navigator.current.setCurrentContext = setCurrentContext;
103
+
142
104
  return (
143
105
  <SafeAreaProvider>
144
106
  <MiniAppContext.Provider
@@ -163,69 +125,72 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
163
125
  showGrid,
164
126
  translate,
165
127
  }}>
166
- <NavigationIndependentTree>
167
- <ReactNavigationContainer
168
- theme={{
169
- dark: false,
170
- colors: {
171
- primary: theme.colors.primary,
172
- background: theme.colors.background.default,
173
- card: theme.colors.background.surface,
174
- text: theme.colors.text.default,
175
- border: theme.colors.border.default,
176
- notification: theme.colors.error.primary,
177
- },
178
- fonts: {
179
- regular: {
180
- fontFamily: 'SFProText',
181
- fontWeight: '400',
182
- },
183
- medium: {
184
- fontFamily: 'SFProText',
185
- fontWeight: '400',
186
- },
187
- bold: {
188
- fontFamily: 'SFProText',
189
- fontWeight: '400',
190
- },
191
- heavy: {
192
- fontFamily: 'SFProText',
193
- fontWeight: '400',
194
- },
195
- },
196
- }}
197
- ref={navigationRef}
198
- onReady={onReady}
199
- onStateChange={onStateChange}>
200
- <Stack.Navigator
201
- initialRouteName="Stack"
202
- screenOptions={{
203
- headerMode: 'screen',
204
- }}>
205
- <Stack.Screen
206
- name="Stack"
207
- component={StackScreen}
208
- initialParams={{screen, initialParams}}
209
- options={{
210
- ...getStackOptions(),
211
- ...(options as StackNavigationOptions),
212
- }}
213
- />
214
- <Stack.Screen
215
- name="Dialog"
216
- component={StackScreen}
217
- options={getDialogOptions()}
218
- initialParams={{screen}}
219
- />
220
- <Stack.Screen
221
- name="Modal"
222
- component={ModalScreen}
223
- options={getModalOptions()}
224
- initialParams={{screen}}
225
- />
226
- </Stack.Navigator>
227
- </ReactNavigationContainer>
228
- </NavigationIndependentTree>
128
+ <ReactNavigationContainer
129
+ theme={{
130
+ ...theme,
131
+ colors: {
132
+ ...theme.colors,
133
+ background: theme.colors.background.default,
134
+ card: theme.colors.background.surface,
135
+ text: theme.colors.text.default,
136
+ border: theme.colors.border.default,
137
+ notification: theme.colors.error.primary,
138
+ },
139
+ }}
140
+ ref={navigationRef}
141
+ onReady={() => {
142
+ isReady.current = true;
143
+ routes.current = navigationRef.current?.getRootState?.()?.routes;
144
+ maxApi?.getDataObserver('CURRENT_SCREEN', (data: any) => {
145
+ onScreenNavigated(data?.screenName, screen?.name, 'push');
146
+ maxApi?.setObserver('CURRENT_SCREEN', {
147
+ screenName: screen?.name,
148
+ });
149
+ });
150
+ }}
151
+ onStateChange={state => {
152
+ const lastedRoute: any =
153
+ state?.routes?.[state?.routes?.length - 1];
154
+ const oldRoute: any =
155
+ routes.current?.[routes.current?.length - 1];
156
+ const lasted = lastedRoute?.params?.screen;
157
+ const previous = oldRoute?.params?.screen;
158
+ const preScreenName = previous?.name ?? previous?.type?.name;
159
+ const screenName = lasted?.name ?? lasted?.type?.name;
160
+
161
+ let action = 'push';
162
+ if (routes.current?.length > (state?.routes?.length ?? 0)) {
163
+ action = 'back';
164
+ }
165
+ onScreenNavigated(preScreenName, screenName, action);
166
+ maxApi?.setObserver('CURRENT_SCREEN', {screenName});
167
+ routes.current = state?.routes;
168
+ }}
169
+ independent={true}>
170
+ <Stack.Navigator initialRouteName="Stack" headerMode="screen">
171
+ <Stack.Screen
172
+ name="Stack"
173
+ component={StackScreen}
174
+ initialParams={{screen, initialParams}}
175
+ options={{
176
+ ...getStackOptions(),
177
+ ...(options as StackNavigationOptions),
178
+ }}
179
+ />
180
+ <Stack.Screen
181
+ name="Dialog"
182
+ component={StackScreen}
183
+ options={getDialogOptions()}
184
+ initialParams={{screen}}
185
+ />
186
+ <Stack.Screen
187
+ name="Modal"
188
+ component={ModalScreen}
189
+ options={getModalOptions()}
190
+ initialParams={{screen}}
191
+ />
192
+ </Stack.Navigator>
193
+ </ReactNavigationContainer>
229
194
  </ApplicationContext.Provider>
230
195
  </MiniAppContext.Provider>
231
196
  </SafeAreaProvider>
@@ -1,6 +1,6 @@
1
1
  import React, {useContext, useEffect, useLayoutEffect, useRef} from 'react';
2
+ import {useHeaderHeight} from '@react-navigation/stack';
2
3
  import {Alert, InteractionManager} from 'react-native';
3
- import {useHeaderHeight} from '@react-navigation/elements';
4
4
  import {ScreenParams} from './types';
5
5
  import Navigation from './Navigation';
6
6
  import {ApplicationContext, MiniAppContext, ScreenContext} from './index';
@@ -77,14 +77,14 @@ const StackScreen: React.FC<ScreenParams> = props => {
77
77
  context,
78
78
  (data: any) => {
79
79
  tracking.current.traceIdLoad = data?.traceId;
80
- },
80
+ }
81
81
  );
82
82
  navigator?.maxApi?.startTraceScreenInteraction?.(
83
83
  screenName,
84
84
  context,
85
85
  (data: any) => {
86
86
  tracking.current.traceIdInteraction = data?.traceId;
87
- },
87
+ }
88
88
  );
89
89
 
90
90
  tracking.current.timeoutTracking = setTimeout(() => {
@@ -121,7 +121,7 @@ const StackScreen: React.FC<ScreenParams> = props => {
121
121
  navigator?.maxApi?.stopTrace?.(
122
122
  tracking.current.traceIdLoad,
123
123
  {value: timeLoad / 1000},
124
- null,
124
+ null
125
125
  );
126
126
  tracking.current.releaseLoad = true;
127
127
 
@@ -139,7 +139,7 @@ const StackScreen: React.FC<ScreenParams> = props => {
139
139
  ) {
140
140
  Alert.alert(
141
141
  `${screenName}- load ${timeLoad}ms`,
142
- JSON.stringify(lastElement.current?.children?.current),
142
+ JSON.stringify(lastElement.current?.children?.current)
143
143
  );
144
144
  }
145
145
  }
@@ -169,7 +169,7 @@ const StackScreen: React.FC<ScreenParams> = props => {
169
169
  navigator?.maxApi?.stopTrace?.(
170
170
  tracking.current.traceIdInteraction,
171
171
  {value: tracking.current.timeInteraction / 1000},
172
- null,
172
+ null
173
173
  );
174
174
  tracking.current.releaseInteraction = true;
175
175
 
@@ -25,203 +25,8 @@ import {
25
25
  import {InputMoneyProps} from './index';
26
26
  import styles from './styles';
27
27
  import {formatMoneyToNumber, formatNumberToMoney} from './utils';
28
+ import {Input} from '@momo-kits/foundation';
28
29
 
29
- const InputMoney = forwardRef(
30
- (
31
- {
32
- onChangeText,
33
- floatingValue,
34
- floatingIcon,
35
- size = 'small',
36
- loading,
37
- onBlur,
38
- onFocus,
39
- errorMessage,
40
- icon,
41
- iconColor,
42
- onPressIcon,
43
- trailing,
44
- trailingColor,
45
- onPressTrailing,
46
- disabled = false,
47
- floatingIconColor,
48
- required = false,
49
- errorSpacing,
50
- style,
51
- params,
52
- defaultValue = '',
53
- accessibilityLabel,
54
- hintText,
55
- value: _value,
56
- onPressFloatingIcon,
57
- placeholder = '0đ',
58
- currency = 'đ',
59
- showClearIcon = true,
60
- ...props
61
- }: InputMoneyProps,
62
- ref
63
- ) => {
64
- const {theme} = useContext(ApplicationContext);
65
-
66
- const [focused, setFocused] = useState(false);
67
- const inputRef = useRef<TextInput>(null);
68
-
69
- useEffect(() => {
70
- if (_value) {
71
- setValue(validateText(_value));
72
- onChangeText?.(formatMoneyToNumber(_value, currency).toString());
73
- }
74
- }, [_value]);
75
-
76
- const validateText = (text: string) => {
77
- const valueFormat = formatMoneyToNumber(text, currency);
78
- return formatNumberToMoney(valueFormat, currency);
79
- };
80
-
81
- const [value, setValue] = useState(
82
- defaultValue ? validateText(defaultValue) : ''
83
- );
84
-
85
- const onClearText = () => {
86
- inputRef?.current?.clear();
87
- setValue('');
88
- onChangeText?.('');
89
- };
90
-
91
- const _onChangeText = (text: string) => {
92
- if (text.length < value.length && value.indexOf(text) === 0) {
93
- text = value.slice(0, -2) + currency;
94
- }
95
- setValue(validateText(text));
96
- onChangeText?.(formatMoneyToNumber(text, currency).toString());
97
- };
98
-
99
- useImperativeHandle(ref, () => {
100
- return {
101
- clear: onClearText,
102
- focus: () => inputRef.current?.focus(),
103
- blur: () => inputRef.current?.blur(),
104
- setText: _onChangeText,
105
- };
106
- });
107
-
108
- const _onFocus = (e: NativeSyntheticEvent<TextInputFocusEventData>) => {
109
- setFocused(true);
110
- onFocus?.(e);
111
- };
112
-
113
- const _onBlur = (e: NativeSyntheticEvent<TextInputFocusEventData>) => {
114
- setFocused(false);
115
- onBlur?.(e);
116
- };
117
-
118
- const renderInputView = () => {
119
- const disabledColor = theme.colors.text.disable;
120
- let textColor = theme.colors.text.default;
121
- let placeholderColor = theme.colors.text.hint;
122
- let iconTintColor = trailingColor ?? iconColor;
123
-
124
- if (disabled) {
125
- textColor = disabledColor;
126
- placeholderColor = disabledColor;
127
- iconTintColor = disabledColor;
128
- }
129
-
130
- return (
131
- <View
132
- style={[
133
- styles.inputWrapper,
134
- {backgroundColor: theme.colors.background.surface},
135
- getSizeStyle(size),
136
- getBorderColor(theme, focused, errorMessage, disabled),
137
- ]}>
138
- <FloatingView
139
- floatingValue={floatingValue}
140
- floatingIconColor={floatingIconColor}
141
- disabled={disabled}
142
- required={required}
143
- floatingIcon={floatingIcon}
144
- onPress={onPressFloatingIcon}
145
- />
146
- <View style={styles.inputView}>
147
- <TextInput
148
- {...props}
149
- accessibilityLabel={accessibilityLabel}
150
- editable={!disabled}
151
- ref={inputRef}
152
- keyboardType={'number-pad'}
153
- allowFontScaling={false}
154
- style={[
155
- styles.moneyInput,
156
- {
157
- color: textColor,
158
- },
159
- ]}
160
- value={value}
161
- onChangeText={_onChangeText}
162
- onFocus={_onFocus}
163
- onBlur={_onBlur}
164
- selectionColor={theme.colors.primary}
165
- placeholderTextColor={placeholderColor}
166
- placeholder={placeholder}
167
- />
168
- </View>
169
- <View style={styles.iconView}>
170
- {showClearIcon && focused && (
171
- <TouchableOpacity
172
- style={styles.iconWrapper}
173
- onPress={onClearText}>
174
- <Icon
175
- source="24_navigation_close_circle_full"
176
- size={16}
177
- color={theme.colors.text.hint}
178
- />
179
- </TouchableOpacity>
180
- )}
181
- <RenderTrailing
182
- color={iconTintColor}
183
- icon={icon}
184
- trailing={trailing}
185
- onPressTrailing={onPressTrailing}
186
- onPressIcon={onPressIcon}
187
- loading={loading}
188
- />
189
- </View>
190
- </View>
191
- );
192
- };
193
-
194
- let inputState = 'active';
195
-
196
- if (value && value?.length > 0) {
197
- inputState = 'filled';
198
- }
199
- if (errorMessage && errorMessage?.length > 0) {
200
- inputState = 'error';
201
- }
202
-
203
- if (disabled) {
204
- inputState = 'disabled';
205
- }
206
-
207
- return (
208
- <ComponentContext.Provider
209
- value={{
210
- componentName: 'InputMoney',
211
- params,
212
- state: inputState,
213
- }}>
214
- <View style={[style, styles.wrapper]}>
215
- {renderInputView()}
216
- <ErrorView
217
- errorMessage={errorMessage}
218
- errorSpacing={errorSpacing}
219
- hintText={hintText}
220
- />
221
- </View>
222
- </ComponentContext.Provider>
223
- );
224
- }
225
- );
30
+ const InputMoney = Input;
226
31
 
227
32
  export default InputMoney;
package/Layout/Screen.tsx CHANGED
@@ -1,5 +1,4 @@
1
- import {StackNavigationOptions} from '@react-navigation/stack';
2
- import {useHeaderHeight} from '@react-navigation/elements';
1
+ import {StackNavigationOptions, useHeaderHeight} from '@react-navigation/stack';
3
2
  import React, {
4
3
  forwardRef,
5
4
  Fragment,
@@ -176,14 +175,14 @@ const Screen = forwardRef(
176
175
  headerBackground,
177
176
  gradientColor,
178
177
  }: ScreenProps,
179
- ref: any,
178
+ ref: any
180
179
  ) => {
181
180
  const screenRef = useRef<View | ScrollView>();
182
181
  const {theme} = useContext(ApplicationContext);
183
182
  const insets = useSafeAreaInsets();
184
183
  const heightHeader = useHeaderHeight();
185
184
  const animatedValue = useRef<Animated.Value>(
186
- customAnimatedValue || new Animated.Value(0),
185
+ customAnimatedValue || new Animated.Value(0)
187
186
  );
188
187
  const currentTint = useRef<string | undefined>(undefined);
189
188
  const isTab = navigation?.instance?.getState?.()?.type === 'tab';
@@ -424,7 +423,7 @@ const Screen = forwardRef(
424
423
  }
425
424
  }
426
425
  },
427
- },
426
+ }
428
427
  );
429
428
  }
430
429
 
@@ -574,7 +573,7 @@ const Screen = forwardRef(
574
573
  </KeyboardAvoidingView>
575
574
  </View>
576
575
  );
577
- },
576
+ }
578
577
  );
579
578
 
580
579
  export default Screen;
package/Layout/index.ts CHANGED
@@ -7,7 +7,6 @@ import {GridContextProps} from './types';
7
7
  import Item from './Item';
8
8
  import ItemList from './ItemList';
9
9
  import ItemSectionList from './ItemSectionList';
10
- import Screen from './Screen';
11
10
 
12
11
  const GridContext = createContext<GridContextProps>({
13
12
  numberOfColumns: 12,
@@ -25,5 +24,4 @@ export {
25
24
  Item,
26
25
  ItemList,
27
26
  ItemSectionList,
28
- Screen,
29
27
  };
package/index.ts CHANGED
@@ -49,3 +49,10 @@ export * from './Title';
49
49
  export * from './Title/types';
50
50
  export * from './Badge';
51
51
  export * from './Badge/types';
52
+
53
+ /**
54
+ * export trick for keep old mini app working
55
+ * @deprecated
56
+ */
57
+ export * from 'react-native-modalize';
58
+ export * from '@gorhom/bottom-sheet';
package/package.json CHANGED
@@ -1,35 +1,50 @@
1
1
  {
2
- "name": "@momo-kits/foundation",
3
- "version": "0.112.1-rn76.7",
4
- "description": "React Native Component Kits",
5
- "main": "index.ts",
6
- "scripts": {},
7
- "keywords": [
8
- "@momo-kits/foundation"
9
- ],
10
- "dependencies": {
11
- "react-native-safe-area-context": "5.1.0",
12
- "react-native-linear-gradient": "2.8.3",
13
- "react-native-gesture-handler": "2.22.0",
14
- "react-native-fast-image": "8.6.3",
15
- "react-native-reanimated": "3.16.7",
16
- "lottie-react-native": "7.2.2",
17
- "@react-navigation/bottom-tabs": "7.2.0",
18
- "@react-navigation/core": "7.3.1",
19
- "@react-navigation/native": "7.0.14",
20
- "@react-navigation/routers": "7.1.2",
21
- "@react-navigation/stack": "7.1.1",
22
- "@react-navigation/elements": "2.2.5"
23
- },
24
- "peerDependencies": {
25
- "react-native": "*"
26
- },
27
- "devDependencies": {
28
- "@momo-platform/versions": "4.1.11",
29
- "@types/color": "3.0.6"
30
- },
31
- "publishConfig": {
32
- "registry": "https://registry.npmjs.org/"
33
- },
34
- "license": "MoMo"
35
- }
2
+ "name": "@momo-kits/foundation",
3
+ "version": "0.112.1-testing.20",
4
+ "description": "React Native Component Kits",
5
+ "main": "index.ts",
6
+ "scripts": {},
7
+ "keywords": [
8
+ "@momo-kits/foundation"
9
+ ],
10
+ "dependencies": {
11
+ "@gorhom/bottom-sheet": "2.4.1",
12
+ "react-native-modalize": "2.1.1",
13
+ "react-native-safe-area-context": "3.1.4",
14
+ "react-native-linear-gradient": "2.8.3",
15
+ "react-native-gesture-handler": "1.10.3",
16
+ "react-native-fast-image": "8.1.5",
17
+ "@react-navigation/bottom-tabs": "https://gitlab.mservice.com.vn/momo-platform/react-native-bottom-tabs.git",
18
+ "@react-navigation/core": "5.16.1",
19
+ "@react-navigation/native": "5.9.8",
20
+ "@react-navigation/routers": "5.7.4",
21
+ "react-native-reanimated": "git+https://gitlab.mservice.com.vn/momo-platform/react-native-reanimated.git#v1.13.4_gradle_7",
22
+ "lottie-react-native": "git+https://gitlab.mservice.com.vn/momo-platform/momo-lottie-react-native.git",
23
+ "@react-navigation/stack": "https://gitlab.mservice.com.vn/momo-platform/react-navigation-stack.git"
24
+ },
25
+ "peerDependencies": {
26
+ "react-native": "*"
27
+ },
28
+ "devDependencies": {
29
+ "@babel/core": "^7.12.9",
30
+ "@babel/runtime": "^7.12.5",
31
+ "@react-native-community/eslint-config": "^2.0.0",
32
+ "@types/jest": "26.0.23",
33
+ "@types/react-native": "0.64.4",
34
+ "@types/react-test-renderer": "16.9.2",
35
+ "@types/d3-shape": "1.3.7",
36
+ "babel-jest": "^26.6.3",
37
+ "eslint": "^7.14.0",
38
+ "jest": "^26.6.3",
39
+ "metro-react-native-babel-preset": "^0.64.0",
40
+ "react-test-renderer": "17.0.1",
41
+ "typescript": "^4.0.3",
42
+ "@momo-platform/versions": "4.1.11",
43
+ "react-scanner": "^1.1.0",
44
+ "@types/color": "3.0.6"
45
+ },
46
+ "publishConfig": {
47
+ "registry": "https://registry.npmjs.org/"
48
+ },
49
+ "license": "MoMo"
50
+ }
package/publish.sh CHANGED
@@ -2,16 +2,16 @@
2
2
 
3
3
 
4
4
  if [ "$1" == "stable" ]; then
5
- #npm version $(npm view @momo-kits/foundation@stable version)
6
- #npm version patch
5
+ npm version $(npm view @momo-kits/foundation@stable version)
6
+ npm version patch
7
7
  npm publish --tag stable --access=public
8
8
  elif [ "$1" == "latest" ]; then
9
- #npm version $(npm view @momo-kits/foundation@latest version)
10
- #npm version prerelease --preid=rc
9
+ npm version $(npm view @momo-kits/foundation@latest version)
10
+ npm version prerelease --preid=rc
11
11
  npm publish --tag latest --access=public
12
12
  else
13
- #npm version $(npm view @momo-kits/foundation@beta version)
14
- #npm version prerelease --preid=beta
13
+ npm version $(npm view @momo-kits/foundation@beta version)
14
+ npm version prerelease --preid=beta
15
15
  npm publish --tag beta --access=public
16
16
  fi
17
17
  PACKAGE_NAME=$(npm pkg get name)