@momo-kits/foundation 0.89.4-react-native.0.71.1 → 0.89.4-tracking.14
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.
- package/Application/BottomTab.tsx +0 -2
- package/Application/Components.tsx +18 -4
- package/Application/NavigationContainer.tsx +6 -2
- package/Application/Navigator.ts +51 -31
- package/Application/StackScreen.tsx +45 -4
- package/Application/types.ts +1 -1
- package/Application/utils.tsx +36 -3
- package/Assets/icon.json +5 -5
- package/Button/index.tsx +42 -14
- package/CheckBox/index.tsx +40 -20
- package/CheckBox/types.ts +4 -0
- package/IconButton/index.tsx +30 -7
- package/Image/index.tsx +1 -2
- package/Input/Input.tsx +35 -4
- package/Input/InputDropDown.tsx +24 -4
- package/Input/InputMoney.tsx +35 -4
- package/Input/InputOTP.tsx +25 -7
- package/Input/InputSearch.tsx +56 -26
- package/Input/index.tsx +27 -2
- package/Input/styles.ts +0 -1
- package/Layout/Screen.tsx +1 -1
- package/Layout/index.ts +0 -2
- package/Loader/DotLoader.tsx +1 -1
- package/Loader/Spinner.tsx +2 -1
- package/Radio/index.tsx +39 -19
- package/Radio/types.ts +5 -0
- package/Switch/index.tsx +31 -14
- package/Switch/types.ts +4 -0
- package/package.json +23 -13
|
@@ -62,11 +62,9 @@ const BottomTab: React.FC<BottomTabProps> = ({
|
|
|
62
62
|
<Tab.Navigator
|
|
63
63
|
initialRouteName={initialRouteName}
|
|
64
64
|
backBehavior={'firstRoute'}
|
|
65
|
-
screenOptions={{headerShown: false}}
|
|
66
65
|
tabBarOptions={{
|
|
67
66
|
style: {
|
|
68
67
|
height: 68 + Math.min(insets.bottom, 21),
|
|
69
|
-
borderWidth: 0,
|
|
70
68
|
},
|
|
71
69
|
tabStyle: {
|
|
72
70
|
height: 68,
|
|
@@ -6,6 +6,7 @@ import React, {
|
|
|
6
6
|
useState,
|
|
7
7
|
} from 'react';
|
|
8
8
|
import {
|
|
9
|
+
Alert,
|
|
9
10
|
Animated,
|
|
10
11
|
BackHandler,
|
|
11
12
|
DeviceEventEmitter,
|
|
@@ -121,6 +122,16 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
|
|
|
121
122
|
const canGoBack = navigator?.ref.current?.canGoBack();
|
|
122
123
|
if (!canGoBack) {
|
|
123
124
|
const currentRoute = navigator?.ref?.current.getCurrentRoute();
|
|
125
|
+
Alert.alert(
|
|
126
|
+
'service_icon_clicked',
|
|
127
|
+
JSON.stringify({
|
|
128
|
+
...context,
|
|
129
|
+
screen_name:
|
|
130
|
+
currentRoute?.params?.screen?.name ?? currentRoute?.name,
|
|
131
|
+
trigger_id: '111154000000000000',
|
|
132
|
+
icon_name: 'back',
|
|
133
|
+
}),
|
|
134
|
+
);
|
|
124
135
|
navigator?.maxApi?.trackEvent?.('service_icon_clicked', {
|
|
125
136
|
...context,
|
|
126
137
|
screen_name: currentRoute?.params?.screen?.name ?? currentRoute?.name,
|
|
@@ -287,6 +298,7 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
287
298
|
preventBack,
|
|
288
299
|
}) => {
|
|
289
300
|
const {theme, navigator} = useContext(ApplicationContext);
|
|
301
|
+
const miniContext = useContext(MiniAppContext);
|
|
290
302
|
const [toolConfig, setToolConfig] = useState<any>();
|
|
291
303
|
const {onAction} = toolConfig ?? {};
|
|
292
304
|
|
|
@@ -296,10 +308,12 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
296
308
|
}
|
|
297
309
|
|
|
298
310
|
useEffect(() => {
|
|
299
|
-
if (
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
311
|
+
if (miniContext?.toolkitConfig?.hidden === false) {
|
|
312
|
+
if (navigator?.toolkitConfig) {
|
|
313
|
+
setToolConfig(navigator?.toolkitConfig);
|
|
314
|
+
} else {
|
|
315
|
+
getToolkitConfig();
|
|
316
|
+
}
|
|
303
317
|
}
|
|
304
318
|
}, []);
|
|
305
319
|
|
|
@@ -25,8 +25,9 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
|
|
|
25
25
|
localization,
|
|
26
26
|
}) => {
|
|
27
27
|
const context = useContext(MiniAppContext);
|
|
28
|
-
const navigationRef =
|
|
29
|
-
const
|
|
28
|
+
const navigationRef = useRef<NavigationContainerRef>(null);
|
|
29
|
+
const isReady = useRef(false);
|
|
30
|
+
const navigator = useRef(new Navigator(navigationRef, isReady));
|
|
30
31
|
const [showGrid, setShowGrid] = useState(false);
|
|
31
32
|
const config = useRef<any>();
|
|
32
33
|
|
|
@@ -89,6 +90,9 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
|
|
|
89
90
|
},
|
|
90
91
|
}}
|
|
91
92
|
ref={navigator.current?.ref}
|
|
93
|
+
onReady={() => {
|
|
94
|
+
isReady.current = true;
|
|
95
|
+
}}
|
|
92
96
|
independent={true}>
|
|
93
97
|
<Stack.Navigator initialRouteName="Stack" headerMode="screen">
|
|
94
98
|
<Stack.Screen
|
package/Application/Navigator.ts
CHANGED
|
@@ -8,13 +8,15 @@ import {
|
|
|
8
8
|
|
|
9
9
|
class Navigator {
|
|
10
10
|
ref?: any;
|
|
11
|
+
isReady?: any;
|
|
11
12
|
toolkitConfig?: HeaderToolkitProps;
|
|
12
13
|
maxApi?: any;
|
|
13
14
|
dismissData?: any;
|
|
14
15
|
toolkitCallback?: (item: any) => void;
|
|
15
16
|
|
|
16
|
-
constructor(navigation: any) {
|
|
17
|
+
constructor(navigation: any, isReady: any) {
|
|
17
18
|
this.ref = navigation;
|
|
19
|
+
this.isReady = isReady;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
/**
|
|
@@ -22,7 +24,9 @@ class Navigator {
|
|
|
22
24
|
* @param params
|
|
23
25
|
*/
|
|
24
26
|
push = (params: ScreenParams) => {
|
|
25
|
-
this.
|
|
27
|
+
if (this.isReady.current) {
|
|
28
|
+
this.ref.current.dispatch(StackActions.push('Stack', params));
|
|
29
|
+
}
|
|
26
30
|
};
|
|
27
31
|
|
|
28
32
|
/**
|
|
@@ -30,14 +34,18 @@ class Navigator {
|
|
|
30
34
|
* @param params
|
|
31
35
|
*/
|
|
32
36
|
replace = (params: ScreenParams) => {
|
|
33
|
-
this.
|
|
37
|
+
if (this.isReady.current) {
|
|
38
|
+
this.ref.current.dispatch(StackActions.replace('Stack', params));
|
|
39
|
+
}
|
|
34
40
|
};
|
|
35
41
|
/**
|
|
36
42
|
* pop to dismiss a screen
|
|
37
43
|
* @param count
|
|
38
44
|
*/
|
|
39
45
|
pop = (count?: number) => {
|
|
40
|
-
this.
|
|
46
|
+
if (this.isReady.current) {
|
|
47
|
+
this.ref.current.dispatch(StackActions.pop(count ?? 1));
|
|
48
|
+
}
|
|
41
49
|
};
|
|
42
50
|
|
|
43
51
|
/**
|
|
@@ -45,7 +53,9 @@ class Navigator {
|
|
|
45
53
|
* @param params
|
|
46
54
|
*/
|
|
47
55
|
present = (params: ScreenParams) => {
|
|
48
|
-
this.
|
|
56
|
+
if (this.isReady.current) {
|
|
57
|
+
this.ref.current.dispatch(StackActions.push('Dialog', params));
|
|
58
|
+
}
|
|
49
59
|
};
|
|
50
60
|
|
|
51
61
|
/**
|
|
@@ -53,7 +63,9 @@ class Navigator {
|
|
|
53
63
|
* @param params
|
|
54
64
|
*/
|
|
55
65
|
showModal = (params: ModalParams) => {
|
|
56
|
-
this.
|
|
66
|
+
if (this.isReady.current) {
|
|
67
|
+
this.ref.current.dispatch(StackActions.push('Modal', params));
|
|
68
|
+
}
|
|
57
69
|
};
|
|
58
70
|
|
|
59
71
|
/**
|
|
@@ -61,19 +73,23 @@ class Navigator {
|
|
|
61
73
|
* @param params
|
|
62
74
|
*/
|
|
63
75
|
showBottomSheet = (params: BottomSheetParams) => {
|
|
64
|
-
this.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
if (this.isReady.current) {
|
|
77
|
+
this.ref.current.dispatch(
|
|
78
|
+
StackActions.push('Modal', {
|
|
79
|
+
...params,
|
|
80
|
+
isBottomSheet: true,
|
|
81
|
+
}),
|
|
82
|
+
);
|
|
83
|
+
}
|
|
70
84
|
};
|
|
71
85
|
|
|
72
86
|
/**
|
|
73
87
|
* pop all screen route
|
|
74
88
|
*/
|
|
75
89
|
popToTop = () => {
|
|
76
|
-
this.
|
|
90
|
+
if (this.isReady.current) {
|
|
91
|
+
this.ref.current.dispatch(StackActions.popToTop());
|
|
92
|
+
}
|
|
77
93
|
};
|
|
78
94
|
|
|
79
95
|
/**
|
|
@@ -82,12 +98,14 @@ class Navigator {
|
|
|
82
98
|
* @param params
|
|
83
99
|
*/
|
|
84
100
|
navigate = (name: string, params: any) => {
|
|
85
|
-
this.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
101
|
+
if (this.isReady.current) {
|
|
102
|
+
this.ref.current.dispatch(
|
|
103
|
+
CommonActions.navigate({
|
|
104
|
+
name,
|
|
105
|
+
params,
|
|
106
|
+
}),
|
|
107
|
+
);
|
|
108
|
+
}
|
|
91
109
|
};
|
|
92
110
|
|
|
93
111
|
/**
|
|
@@ -95,18 +113,20 @@ class Navigator {
|
|
|
95
113
|
* @param params
|
|
96
114
|
*/
|
|
97
115
|
reset = (params: ScreenParams) => {
|
|
98
|
-
this.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
116
|
+
if (this.isReady.current) {
|
|
117
|
+
this.ref.current.dispatch(
|
|
118
|
+
CommonActions.reset({
|
|
119
|
+
index: 0,
|
|
120
|
+
routes: [
|
|
121
|
+
{
|
|
122
|
+
name: 'Stack',
|
|
123
|
+
key: `Stack_${new Date().getTime()}`,
|
|
124
|
+
params,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
}),
|
|
128
|
+
);
|
|
129
|
+
}
|
|
110
130
|
};
|
|
111
131
|
|
|
112
132
|
/**
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import React, {useContext, useEffect, useLayoutEffect} from 'react';
|
|
1
|
+
import React, {useContext, useEffect, useLayoutEffect, useRef} from 'react';
|
|
2
2
|
import {ScreenParams} from './types';
|
|
3
3
|
import Navigation from './Navigation';
|
|
4
4
|
import {ApplicationContext, MiniAppContext} from './index';
|
|
5
5
|
import {GridSystem} from '../Layout';
|
|
6
|
-
import {useHeaderHeight} from '@react-navigation/
|
|
6
|
+
import {useHeaderHeight} from '@react-navigation/stack';
|
|
7
|
+
import {Alert} from 'react-native';
|
|
8
|
+
|
|
9
|
+
const {
|
|
10
|
+
ScreenContext,
|
|
11
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
7
12
|
|
|
8
13
|
const StackScreen: React.FC<ScreenParams> = props => {
|
|
9
14
|
const {theme, showGrid, navigator} = useContext(ApplicationContext);
|
|
15
|
+
const startTime = useRef(Date.now());
|
|
16
|
+
const endTime = useRef(Date.now());
|
|
17
|
+
const timeLoad = useRef(0);
|
|
18
|
+
const timeout = useRef<any>();
|
|
19
|
+
|
|
10
20
|
const context = useContext(MiniAppContext);
|
|
11
21
|
|
|
12
22
|
const {screen: Component, options}: ScreenParams = props.route.params;
|
|
@@ -51,20 +61,51 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
51
61
|
trigger_id: '111378000000000000',
|
|
52
62
|
});
|
|
53
63
|
|
|
64
|
+
Alert.alert(
|
|
65
|
+
'service_frame_displayed',
|
|
66
|
+
JSON.stringify({
|
|
67
|
+
...tracking,
|
|
68
|
+
pre_screen_name,
|
|
69
|
+
trigger_id: '111378000000000000',
|
|
70
|
+
}),
|
|
71
|
+
);
|
|
54
72
|
return props.navigation.addListener('beforeRemove', () => {
|
|
55
73
|
navigator?.maxApi?.trackEvent?.('service_icon_clicked', {
|
|
56
74
|
...tracking,
|
|
57
75
|
trigger_id: '111154000000000000',
|
|
58
76
|
icon_name: 'back',
|
|
59
77
|
});
|
|
78
|
+
Alert.alert(
|
|
79
|
+
'service_icon_clicked',
|
|
80
|
+
JSON.stringify({
|
|
81
|
+
...tracking,
|
|
82
|
+
trigger_id: '111154000000000000',
|
|
83
|
+
icon_name: 'back',
|
|
84
|
+
}),
|
|
85
|
+
);
|
|
60
86
|
});
|
|
61
87
|
}, []);
|
|
62
88
|
|
|
63
89
|
return (
|
|
64
|
-
|
|
90
|
+
<ScreenContext.Provider
|
|
91
|
+
value={{
|
|
92
|
+
appId: context.appId,
|
|
93
|
+
code: context.code,
|
|
94
|
+
screenName: Component.name,
|
|
95
|
+
autoTracking: (data: any) => {
|
|
96
|
+
navigator?.maxApi?.dispatchFunction?.('autoTracking', data);
|
|
97
|
+
},
|
|
98
|
+
onElementLoad: () => {
|
|
99
|
+
endTime.current = Date.now();
|
|
100
|
+
clearTimeout(timeout.current);
|
|
101
|
+
timeout.current = setTimeout(() => {
|
|
102
|
+
timeLoad.current = endTime.current - startTime.current;
|
|
103
|
+
}, 1000);
|
|
104
|
+
},
|
|
105
|
+
}}>
|
|
65
106
|
<Component heightHeader={heightHeader} {...params} />
|
|
66
107
|
{showGrid && <GridSystem />}
|
|
67
|
-
|
|
108
|
+
</ScreenContext.Provider>
|
|
68
109
|
);
|
|
69
110
|
};
|
|
70
111
|
|
package/Application/types.ts
CHANGED
package/Application/utils.tsx
CHANGED
|
@@ -126,7 +126,6 @@ const getOptions = (params: NavigationOptions, theme: Theme) => {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
if (params.toolkitParams) {
|
|
130
129
|
options = {
|
|
131
130
|
...options,
|
|
132
131
|
headerRight: (props: any) => {
|
|
@@ -140,7 +139,6 @@ const getOptions = (params: NavigationOptions, theme: Theme) => {
|
|
|
140
139
|
);
|
|
141
140
|
},
|
|
142
141
|
};
|
|
143
|
-
}
|
|
144
142
|
|
|
145
143
|
return {
|
|
146
144
|
...params,
|
|
@@ -148,4 +146,39 @@ const getOptions = (params: NavigationOptions, theme: Theme) => {
|
|
|
148
146
|
};
|
|
149
147
|
};
|
|
150
148
|
|
|
151
|
-
|
|
149
|
+
const formatComponentName= (word: string) =>{
|
|
150
|
+
const accentsMap = {
|
|
151
|
+
'a': 'á|à|ả|ã|ạ|â|ấ|ầ|ẩ|ẫ|ậ|ă|ắ|ằ|ẳ|ẵ|ặ',
|
|
152
|
+
'A': 'Á|À|Ả|Ã|Ạ|Â|Ấ|Ầ|Ẩ|Ẫ|Ậ|Ă|Ắ|Ằ|Ẳ|Ẵ|Ặ',
|
|
153
|
+
'e': 'é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ',
|
|
154
|
+
'E': 'É|È|Ẻ|Ẽ|Ẹ|Ê|Ế|Ề|Ể|Ễ|Ệ',
|
|
155
|
+
'i': 'í|ì|ỉ|ĩ|ị',
|
|
156
|
+
'I': 'Í|Ì|Ỉ|Ĩ|Ị',
|
|
157
|
+
'o': 'ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ',
|
|
158
|
+
'O': 'Ó|Ò|Ỏ|Õ|Ọ|Ô|Ố|Ồ|Ổ|Ỗ|Ộ|Ơ|Ớ|Ờ|Ở|Ỡ|Ợ',
|
|
159
|
+
'u': 'ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự',
|
|
160
|
+
'U': 'Ú|Ù|Ủ|Ũ|Ụ|Ư|Ứ|Ừ|Ử|Ữ|Ự',
|
|
161
|
+
'y': 'ý|ỳ|ỷ|ỹ|ỵ',
|
|
162
|
+
'Y': 'Ý|Ỳ|Ỷ|Ỹ|Ỵ',
|
|
163
|
+
'd': 'đ',
|
|
164
|
+
'D': 'Đ'
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
for (const [nonAccent, accentGroup] of Object.entries(accentsMap)) {
|
|
168
|
+
const accents = new RegExp(accentGroup, 'g');
|
|
169
|
+
word = word.replace(accents, nonAccent);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
word = word.replace(/\s+/g, '_').toLowerCase();
|
|
173
|
+
|
|
174
|
+
return word;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const formatNameLength = (name: string) =>{
|
|
178
|
+
let formattedName = name
|
|
179
|
+
if (formattedName.length > 100) {
|
|
180
|
+
formattedName = formattedName.substring(0, 100);
|
|
181
|
+
}
|
|
182
|
+
return formattedName
|
|
183
|
+
}
|
|
184
|
+
export {getStackOptions, getDialogOptions, getModalOptions, getOptions, formatComponentName, formatNameLength};
|
package/Assets/icon.json
CHANGED
|
@@ -801,7 +801,7 @@
|
|
|
801
801
|
"uri": "https://img.mservice.com.vn/app/img/kits/navigation_minus_circle_full.png"
|
|
802
802
|
},
|
|
803
803
|
"navigation_more_horiz": {
|
|
804
|
-
"uri": "
|
|
804
|
+
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAgKADAAQAAAABAAAAgAAAAABIjgR3AAAFAklEQVR4Ae2aS4tcRRiGM2rEO14SY7wFURGc+CPEyyYJLnSlaCCKLgSzUNBNRAMSF0LIRhGDBMQQMAQ3Zin+A/VHKOIlTm4aJ5fx+VBCT5Puru9UleOE54OX7nO66n2rnj7dp+ucXrPGkoAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhLoTmCue8JYwNLS0m3s2ooeQXeiJfQj+h59NTc39zuP3Yr89ZhH/mYU+RdQ5H+HIn+Bx25F/u2YR/48ivzzKPK/RUfJP87j5VdM/EH0BTqHJtVZXjiI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z5KABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISuJwI/A2lzL3lHltsxwAAAABJRU5ErkJggg=="
|
|
805
805
|
},
|
|
806
806
|
"navigation_more_vert": {
|
|
807
807
|
"uri": "https://img.mservice.com.vn/app/img/kits/navigation_more_vert.png"
|
|
@@ -822,7 +822,7 @@
|
|
|
822
822
|
"uri": "https://img.mservice.com.vn/app/img/kits/navigation_scan.png"
|
|
823
823
|
},
|
|
824
824
|
"navigation_search": {
|
|
825
|
-
"uri": "
|
|
825
|
+
"uri": "data:image/webp;base64,UklGRqwEAABXRUJQVlA4TKAEAAAvf8AfEDVIchtJkqT6/6fZ21hkukWeZouKkARJtmlbtm3btm3b741sjWzbtm3btm184xkLgiS5cZsGUuXbsJOAoPSD88dlwMVKiDwdxtRJ4UUP+XlwcpVn1A0I4dWOVnEMET7n62avxi24FD4tSyT9AJCpq/YI7oQjYZj3Bp2zU3A/dBDfF0y+bsBMGCK3KTpOwFyoR70h9Nreo+EvXyi7Ye4vmA7TaLcCQy4ohB90NoLaKqiEL1HbwOH84sdyqk+aQC5smHLkKViZWT8vXlACZQ/EfAcXOJa5bPO4uGm51A91wtzix3+w5I88UhfXAw5GL6Rh6Bvcu77smyD4N4okpNkXWIVGSPVXWz7DqyjYN+vEa3yZctrvunwjw9gGSmW3/EXx6ZILFiTM/BYx2FjwRqzabUHmhe1UtXBWS4RTBMW1xt/MLYm5eiGKXqSGnsX3ZwPNaMUsvYMYtGoL/eIymuGauS66JIzSmOMkP4NE9z9GeAdfELGdrxqK0cgj0sqM6Sa/a6NuxI5BCrENnHO763RvvF7jUlV4B8hOY7PHVvq/EQNSCJpHAyS1AQaWs8QZxHGq40oLu9a32IIU5Mc3dx7z76wGipNE0TT28W8WfnHd4hSrhz5MTSKvuW7C9q931W1Cqjo3KK/1Xpxx0ThVVBKTtWVLZhdU/9P8A3OUvIRheXDUmz4AwVFp0fKJsExgwmKUm8BJe26nmggb7XqpWr1t6BK1k7Al0togegyMTiKcCKjv2xwFliaRT7jUWQ3slyZeNnUmAjeTGCdM6wylAzGTqCcc68wGLieRSnjW2QrsjY6sieA6V4Hl0Q1noqx+xM5Xp4NC9hqYbcPXOgJiJ/CzjVmrg2pN5eIsk5YwGiUu4VZmI0E3imGipQtpeqS7Mwqhz7RnhlvFBQTahwu2nArmUGUm4TVMUmKkCRtIMA4jDVIQKpKX2Bov2XGiuQeVl+ahH2HxCD/eGhmpdp/ox2GOV4234PWe6CtUrTMmu9LIaxIkDAqIR75jqOAH4qMhdie299sGnAIaPkDeczWQe8fQNv/F4fAbJLZLZz/U5xQ9DaGDWLMvMq1zLv7mZDl8xMkgiGTU+gbfzDvX0csGFiceYNdAMQ1yyD1zz3AAMsrFdQOtHyCHUcRTb+Q3yBR2z/X7Wp3uxDvS7vj6AAtEu4OTKLAIr2Jg3W/2JsEyXGPrphKwCmds770kKhnewXuzhKITLMMJJ9iXYZX3vdBvlzANg3X4p5wK1CsjLpcfQ96OCV0juBL+6xVIFd2vawEMvEyl2fg+47xrQpIDroZHR1ZNGDJry5VPMBCusXZfjI83cDf2T2JOCxQSdb1VItAwzelXs8e2Vx5ajif5kvHVGvZLGMI9jrH9PWfsmAepWH9mLrH4mrJ2zYNAkLO7fOpjCHHRirfLA5G8In9usCX8x/Zm8zwHOnnhJr1d4E47rx9b24ncI2ARZClMrVFL9t344dKeZb1yBDL6ua+byl1jLl39vktXq8Ty/ET6+NRwHp84H59sXghPT24vhKcnqRfCw9MetPPs9EHyhfDUQKrhx2WS58GBkw030p/3/nUYBw=="
|
|
826
826
|
},
|
|
827
827
|
"navigation_search_add": {
|
|
828
828
|
"uri": "https://img.mservice.com.vn/app/img/kits/navigation_search_add.png"
|
|
@@ -2640,7 +2640,7 @@
|
|
|
2640
2640
|
"uri": "https://img.mservice.io/momo_app_v2/new_version/img/appx_icon/16_navigation_close_circle_full.png"
|
|
2641
2641
|
},
|
|
2642
2642
|
"16_navigation_close_circle": {
|
|
2643
|
-
"uri": "
|
|
2643
|
+
"uri": "data:image/webp;base64,UklGRkICAABXRUJQVlA4TDUCAAAvP8APEM8x//M//wzbRlKcvMws3D1DYBwIAASMF4YAQCHQAAED7AAg8AMYB0DhQCMgGAnwAARuAAHcAABsSCQMYAgFAFIhSQDYtJHKzMzMzB3//2mWbdmahaMVR/QfgiS5cZsB4DskKoXzC7H/FklUBov99fENkd/zoJJwTKqzegmDvEIn5Y706CFQEo3Y0dm9m0AL9yIHNC/CSkLTlvhY5+N50q2XslGo+8lZ5w3HrchshMJhWGStRMGrHm0yFuSOArKtYpyqbhWnjgFvdw84tbF+RSfo1x2rGeX1LBlDS5gpLyPcafAvfvoxK4kC/IM4BnjRsxGzFB/gPZh4g6+tjdnDl+b4S1wAfXYgEQzghIkePM1NYsHDeqZUvYFbk24I4NJbWs9ISFqqG+X5NG/Ch3lZE3/AyZG+zjxAtGvs4/27pid6e//R6A6UkZSOjpBUVebCSzWZ93NNCgE3g441SFVWmQqoJvNB4xhI4pXu5JdkqKHwVtRgnNcQQClNmP4P2kJRU9XghLaMAE8qKgNQpphRijTms2SgspRMGKlI44lkqbKXdBmpSOOuJKhcJXVGKtI4SK4qD0mJEWphHEDkqnwlWcYo3jgrCfTQv6H/Cf1B5HG7+D15UyHLW3zdyDurG+R1i75u0tdtRN9o2/SNAqZv0Pct8r5J37fJ5wbyuYV+biKf22znxpb93Eg+t5LPzeRzO/XeQL63UO9NLve2tXlvW4eU672xOliqe+NywInY/4owAA=="
|
|
2644
2644
|
},
|
|
2645
2645
|
"16_navigation_close": {
|
|
2646
2646
|
"uri": "https://img.mservice.io/momo_app_v2/new_version/img/appx_icon/16_navigation_close.png"
|
|
@@ -3918,7 +3918,7 @@
|
|
|
3918
3918
|
"uri": "https://img.mservice.com.vn/app/img/kits/Phonebook-outline.png"
|
|
3919
3919
|
},
|
|
3920
3920
|
"ic_back": {
|
|
3921
|
-
"uri": "
|
|
3921
|
+
"uri": "data:image/webp;base64,UklGRqIBAABXRUJQVlA4TJYBAAAvX8AXEFVActtIkjT//zRn9WzKYwOJRgQkAADLRtvOtm3btm3b9r1svWzbtm3btu27OHIkN26abK9JbpFIPuE+bAQmFS5c6qcQhrE34CPEZKHr9/kJf0SiUPENfAnNTcj4eH7FaRKiXoGBmyJ4PQILPUGwuwUmtHpgdLFV0RO1461eyDmQ2tsahZYTgY2tGZg54VjcWoabE4aprU1EOaEa3tpHnhOS7q1TNDkhaN66wpQTnKqtOxw5QRVsPeHvLRfSt16J9ZS49UGup/Ctb+o9BW790u/JbeufZU82/jecggWWvy3fnrT8bAX1pORrK7YnKe9byT1RetrKAe2hcqsM7PZwMVEP/h5A/Eb52039I3LfPlL/IUkvkHvA/7q+Lgm+t76u8ikm2/q+cC/37/e1/L5cTGHf1xUH1EX5ui4IqMLv69ID6up4X+AS01se0Ncc0Jcd0Ffm++JgIvxBX9+fS/TnKsHE8O1cqD/XKia+b+Zy/bniAXPRZlAd5ZjmA+bS1WDq51MVI+R2A4tKRx51UL6PD3EB"
|
|
3922
3922
|
},
|
|
3923
3923
|
"share": {
|
|
3924
3924
|
"uri": "https://img.mservice.com.vn/app/img/mini-app-center/share.png"
|
|
@@ -3936,7 +3936,7 @@
|
|
|
3936
3936
|
"uri": "https://img.mservice.com.vn/app/img/kits/error_mess_icon.png"
|
|
3937
3937
|
},
|
|
3938
3938
|
"media_fail": {
|
|
3939
|
-
"uri": "
|
|
3939
|
+
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAW8SURBVHgB7Z1fUts4HMd/kuF1h72Be4IaQmf2rdkTFE7QvUHpCYATEE5QOA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7kM9miYugede6mlrCZFtD9E+YO49IvZ4uPpb6jGNZH3NTvtHYBtH3zmyerVKgq4Brui/MM3JjVHFPb7xS8KyIE9eve5bWB6lrIuzji+rMp1yZXTMySRPQtUaJ3tWz/lS5FHeZrKeZ177JFkFbuShhWbgMzL8bPj5lOjPvTb9oMa3ACKH9s7jk9KAfNBhGWjJ+fWx0b609N3utiwfBaAKV1dUgxWNMogt74eVCvOXf12sMTgJBxwx5xgwh1xo8bLv52dcsAY4DVsptmEbyNLy9NKoXZ8ATgPLbcUyuCt/EN1x5iFuTSj1QRYYFnr27l2p2PB3S9rmZbuqlL/jdsi6AtPi0ggy1Ck/q5DJxUAu4CyzoBmq7tIQAPOoTnwbIAhGRghzbbcagTqmiu7S4Ao/ewVUTLmQfj/1gcZE417eoEPZynq5ucBSiG8a5hW6B8vPSZ8IeGI5ry/NhbBCbGj1dvD3xgzxfq33ZsA2Ql72dMtmBzHLDL8+tEqIkxrOI9vASQ453p09MhbENLkG9UlAJxPlbLbw17u+T5ehHMAtzoxolb1QEixTsTqr8Sf+St+tdOfYXS5Z5IxkyvxMSL1xUt8/wlEfJ3nQz7r4zGLeh93/26EPWKFOGD9ks5uEKIbDX2RVt+TGz49lo9rBqGO01VxjFT0MwN6fbmhdn4WXEtLYMVQPlj90LKlUVGZQzMg56onWcu9BTWI4I0/qmuii4z2BhQxmH81xZjF8YqKECJ2sBsz7X0+bavJqIAK6jWQCJZaLrMuJHGvhWGn9g89WVQAAN58SbGcPMhzNfa19Nlb4DqXmD3oSZ4IAiCINvLD/kvr2MVXk/zAAAAAElFTkSuQmCC"
|
|
3940
3940
|
},
|
|
3941
3941
|
"ic_checked": {
|
|
3942
3942
|
"uri": "https://img.mservice.com.vn/app/img/kits/checked_ic.png"
|
package/Button/index.tsx
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
TouchableOpacityProps,
|
|
7
7
|
View,
|
|
8
8
|
} from 'react-native';
|
|
9
|
-
|
|
10
9
|
import LinearGradient from 'react-native-linear-gradient';
|
|
11
10
|
import {ApplicationContext} from '../Application';
|
|
12
11
|
import {Text} from '../Text';
|
|
@@ -15,6 +14,11 @@ import {Colors, Spacing} from '../Consts';
|
|
|
15
14
|
import styles from './styles';
|
|
16
15
|
import {Icon} from '../Icon';
|
|
17
16
|
import {Loader} from '../Loader';
|
|
17
|
+
import {formatComponentName} from '../Application/utils';
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
ScreenContext,
|
|
21
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
18
22
|
|
|
19
23
|
const AnimationLinear = Animated.createAnimatedComponent(LinearGradient);
|
|
20
24
|
|
|
@@ -70,6 +74,10 @@ export interface ButtonProps extends TouchableOpacityProps {
|
|
|
70
74
|
* A callback function that is called when the button is pressed.
|
|
71
75
|
*/
|
|
72
76
|
onPress: () => void;
|
|
77
|
+
|
|
78
|
+
params?: any;
|
|
79
|
+
|
|
80
|
+
componentId?: string;
|
|
73
81
|
}
|
|
74
82
|
|
|
75
83
|
const Button: FC<ButtonProps> = ({
|
|
@@ -82,6 +90,9 @@ const Button: FC<ButtonProps> = ({
|
|
|
82
90
|
loading = false,
|
|
83
91
|
title = 'Button',
|
|
84
92
|
onPress,
|
|
93
|
+
params,
|
|
94
|
+
componentId,
|
|
95
|
+
accessibilityLabel,
|
|
85
96
|
...rest
|
|
86
97
|
}) => {
|
|
87
98
|
const {theme, config} = useContext(ApplicationContext);
|
|
@@ -94,6 +105,8 @@ const Button: FC<ButtonProps> = ({
|
|
|
94
105
|
end: {x: 0, y: 0.5},
|
|
95
106
|
};
|
|
96
107
|
}
|
|
108
|
+
|
|
109
|
+
const screenInfo = useContext<any>(ScreenContext);
|
|
97
110
|
const getSizeStyle = () => {
|
|
98
111
|
const styleSheet: {[key: string]: any} = styles;
|
|
99
112
|
return styleSheet[size ?? 'small'];
|
|
@@ -291,19 +304,34 @@ const Button: FC<ButtonProps> = ({
|
|
|
291
304
|
const activeOpacity = type === 'disabled' ? 0.75 : 0.5;
|
|
292
305
|
|
|
293
306
|
return (
|
|
294
|
-
<
|
|
295
|
-
{
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
+
<ScreenContext.Provider
|
|
308
|
+
value={{
|
|
309
|
+
...screenInfo,
|
|
310
|
+
componentName: 'Button',
|
|
311
|
+
params,
|
|
312
|
+
state: loading
|
|
313
|
+
? 'loading'
|
|
314
|
+
: type === 'disabled'
|
|
315
|
+
? 'disabled'
|
|
316
|
+
: 'enabled',
|
|
317
|
+
componentId,
|
|
318
|
+
componentValue: formatComponentName(title),
|
|
319
|
+
action: 'click',
|
|
320
|
+
}}>
|
|
321
|
+
<TouchableOpacity
|
|
322
|
+
{...rest}
|
|
323
|
+
activeOpacity={activeOpacity}
|
|
324
|
+
onPress={onPressButton}
|
|
325
|
+
style={buttonStyle}>
|
|
326
|
+
{renderLeading()}
|
|
327
|
+
{renderTitle()}
|
|
328
|
+
{renderTrailing()}
|
|
329
|
+
{gradientPros && (
|
|
330
|
+
<AnimationLinear {...gradientPros} style={styles.gradientView} />
|
|
331
|
+
)}
|
|
332
|
+
{gradientPros && <View style={styles.strokeView} />}
|
|
333
|
+
</TouchableOpacity>
|
|
334
|
+
</ScreenContext.Provider>
|
|
307
335
|
);
|
|
308
336
|
};
|
|
309
337
|
|
package/CheckBox/index.tsx
CHANGED
|
@@ -5,6 +5,11 @@ import styles from './styles';
|
|
|
5
5
|
import {ApplicationContext} from '../Application';
|
|
6
6
|
import {Text} from '../Text';
|
|
7
7
|
import {Icon} from '../Icon';
|
|
8
|
+
import {formatNameLength} from '../Application/utils';
|
|
9
|
+
|
|
10
|
+
const {
|
|
11
|
+
ScreenContext,
|
|
12
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
8
13
|
|
|
9
14
|
const CheckBox: FC<CheckBoxProps> = ({
|
|
10
15
|
value,
|
|
@@ -13,8 +18,11 @@ const CheckBox: FC<CheckBoxProps> = ({
|
|
|
13
18
|
style,
|
|
14
19
|
label,
|
|
15
20
|
indeterminate,
|
|
21
|
+
params,
|
|
22
|
+
componentId,
|
|
16
23
|
}) => {
|
|
17
24
|
const {theme} = useContext(ApplicationContext);
|
|
25
|
+
const screenInfo = useContext<any>(ScreenContext);
|
|
18
26
|
const haveValue = value || indeterminate;
|
|
19
27
|
const iconSource = indeterminate ? 'ic_minus' : 'ic_checked';
|
|
20
28
|
let borderColor = theme.colors.text.default;
|
|
@@ -35,26 +43,38 @@ const CheckBox: FC<CheckBoxProps> = ({
|
|
|
35
43
|
}
|
|
36
44
|
|
|
37
45
|
return (
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
<ScreenContext.Provider
|
|
47
|
+
value={{
|
|
48
|
+
...screenInfo,
|
|
49
|
+
componentName: 'Button',
|
|
50
|
+
params,
|
|
51
|
+
state: disabled ? 'disabled' : 'filled',
|
|
52
|
+
componentId,
|
|
53
|
+
action: 'click',
|
|
54
|
+
componentLabel: formatNameLength(label || ''),
|
|
55
|
+
componentValue: indeterminate ? 'indetermine' : value,
|
|
56
|
+
}}>
|
|
57
|
+
<TouchableOpacity
|
|
58
|
+
activeOpacity={0.8}
|
|
59
|
+
onPress={() => onChange?.(!value)}
|
|
60
|
+
disabled={disabled}
|
|
61
|
+
style={[style, styles.container]}>
|
|
62
|
+
<View
|
|
63
|
+
style={[
|
|
64
|
+
{borderColor, backgroundColor, borderWidth: 1},
|
|
65
|
+
styles.checkbox,
|
|
66
|
+
]}>
|
|
67
|
+
{haveValue && (
|
|
68
|
+
<Icon
|
|
69
|
+
color={theme.colors.background.surface}
|
|
70
|
+
size={20}
|
|
71
|
+
source={iconSource}
|
|
72
|
+
/>
|
|
73
|
+
)}
|
|
74
|
+
</View>
|
|
75
|
+
{!!label && <Text typography={'body_default_regular'}>{label}</Text>}
|
|
76
|
+
</TouchableOpacity>
|
|
77
|
+
</ScreenContext.Provider>
|
|
58
78
|
);
|
|
59
79
|
};
|
|
60
80
|
|