@momo-kits/foundation 0.81.16 → 0.81.17-beta.1
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/ModalScreen.tsx +22 -23
- package/Application/StackScreen.tsx +4 -5
- package/Assets/language.json +3 -1
- package/Icon/index.tsx +0 -1
- package/Icon/types.ts +2 -2
- package/Popup/PopupNotify.tsx +11 -5
- package/Popup/PopupPromotion.tsx +9 -8
- package/Popup/types.ts +3 -3
- package/package.json +1 -1
|
@@ -53,40 +53,39 @@ const Modal: React.FC<ModalParams> = props => {
|
|
|
53
53
|
|
|
54
54
|
delete params.screen;
|
|
55
55
|
|
|
56
|
+
const getTrackingInfo = () => {
|
|
57
|
+
const navigationRoutes = props.navigation.getState()?.routes || [];
|
|
58
|
+
const routesLength = navigationRoutes.length;
|
|
59
|
+
let screen_name = navigationRoutes?.[0]?.params?.screen?.name;
|
|
60
|
+
if (routesLength > 1) {
|
|
61
|
+
screen_name = navigationRoutes[routesLength - 2]?.params?.screen?.name;
|
|
62
|
+
}
|
|
63
|
+
const error_code = screen?.({params: {}})?.props?.error;
|
|
64
|
+
return {
|
|
65
|
+
feature_code: navigator?.trackingInfo?.code,
|
|
66
|
+
app_id: navigator?.trackingInfo?.appId,
|
|
67
|
+
miniapp_version: navigator?.trackingInfo?.buildNumber,
|
|
68
|
+
flow_partner_id: navigator?.trackingInfo?.flowPartnerId,
|
|
69
|
+
screen_name,
|
|
70
|
+
component_type: 'popup',
|
|
71
|
+
component_name: modalName,
|
|
72
|
+
error_code,
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
|
|
56
76
|
/**
|
|
57
77
|
* tracking
|
|
58
78
|
*/
|
|
59
79
|
useEffect(() => {
|
|
60
80
|
if (navigator?.trackingInfo) {
|
|
61
|
-
const navigationRoutes = props.navigation.getState()?.routes || [];
|
|
62
|
-
const routesLength = navigationRoutes.length;
|
|
63
|
-
let screen_name = navigationRoutes?.[0]?.params?.screen?.name;
|
|
64
|
-
if (routesLength > 1) {
|
|
65
|
-
screen_name = navigationRoutes[routesLength - 2]?.params?.screen?.name;
|
|
66
|
-
}
|
|
67
|
-
const error_code = screen?.({params: {}})?.props?.information;
|
|
68
81
|
navigator?.maxApi?.trackEvent('service_component_displayed', {
|
|
69
|
-
|
|
70
|
-
app_id: navigator.trackingInfo.appId,
|
|
71
|
-
miniapp_version: navigator.trackingInfo.buildNumber,
|
|
72
|
-
flow_partner_id: navigator.trackingInfo.flowPartnerId,
|
|
73
|
-
screen_name,
|
|
82
|
+
...getTrackingInfo(),
|
|
74
83
|
trigger_id: '111012100000000000',
|
|
75
|
-
component_type: 'popup',
|
|
76
|
-
component_name: modalName,
|
|
77
|
-
error_code,
|
|
78
84
|
});
|
|
79
|
-
|
|
80
85
|
return () => {
|
|
81
86
|
navigator?.maxApi?.trackEvent('service_icon_clicked', {
|
|
82
|
-
|
|
83
|
-
app_id: navigator?.trackingInfo?.appId,
|
|
84
|
-
miniapp_version: navigator?.trackingInfo?.buildNumber,
|
|
85
|
-
screen_name,
|
|
87
|
+
...getTrackingInfo(),
|
|
86
88
|
trigger_id: '111154100000000001',
|
|
87
|
-
component_type: 'popup',
|
|
88
|
-
component_name: modalName,
|
|
89
|
-
error_code,
|
|
90
89
|
icon_name: 'close',
|
|
91
90
|
});
|
|
92
91
|
};
|
|
@@ -33,11 +33,10 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
33
33
|
useEffect(() => {
|
|
34
34
|
if (navigator?.trackingInfo) {
|
|
35
35
|
const navigationRoutes = props.navigation.getState()?.routes || [];
|
|
36
|
-
const
|
|
37
|
-
let pre_screen_name =
|
|
38
|
-
if (
|
|
39
|
-
pre_screen_name =
|
|
40
|
-
navigationRoutes[routesLength - 2]?.params?.screen?.name;
|
|
36
|
+
const routes = navigationRoutes.length;
|
|
37
|
+
let pre_screen_name = '';
|
|
38
|
+
if (routes > 1) {
|
|
39
|
+
pre_screen_name = navigationRoutes[routes - 2]?.params?.screen?.name;
|
|
41
40
|
}
|
|
42
41
|
navigator?.maxApi?.trackEvent('service_frame_displayed', {
|
|
43
42
|
feature_code: navigator.trackingInfo.code,
|
package/Assets/language.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"vi": {
|
|
3
|
+
"errorCode": "Mã lỗi: ",
|
|
3
4
|
"seeMore": "Xem thêm",
|
|
4
5
|
"cancel": "Huỷ",
|
|
5
6
|
"done": "Xong",
|
|
@@ -195,6 +196,7 @@
|
|
|
195
196
|
"information": "Information",
|
|
196
197
|
"tutorial": "Instruction",
|
|
197
198
|
"question": "FAQ",
|
|
198
|
-
"support": "Support center"
|
|
199
|
+
"support": "Support center",
|
|
200
|
+
"errorCode": "Error code: "
|
|
199
201
|
}
|
|
200
202
|
}
|
package/Icon/index.tsx
CHANGED
package/Icon/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {ImageStyle} from 'react-native-fast-image';
|
|
2
2
|
|
|
3
3
|
export type IconProps = {
|
|
4
4
|
/**
|
|
@@ -23,5 +23,5 @@ export type IconProps = {
|
|
|
23
23
|
* Optional. Used to apply custom styling to the Icon component.
|
|
24
24
|
* Accepts an object of style properties.
|
|
25
25
|
*/
|
|
26
|
-
style?:
|
|
26
|
+
style?: ImageStyle;
|
|
27
27
|
};
|
package/Popup/PopupNotify.tsx
CHANGED
|
@@ -12,13 +12,13 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
12
12
|
image,
|
|
13
13
|
title = 'Title',
|
|
14
14
|
description = 'Description',
|
|
15
|
-
|
|
15
|
+
error,
|
|
16
16
|
secondary,
|
|
17
17
|
primary,
|
|
18
18
|
buttonDirection = 'row',
|
|
19
19
|
onIconClose,
|
|
20
20
|
}) => {
|
|
21
|
-
const {theme, navigator} = useContext(ApplicationContext);
|
|
21
|
+
const {theme, navigator, translate} = useContext(ApplicationContext);
|
|
22
22
|
const [scrollContent, setScrollContent] = useState(false);
|
|
23
23
|
|
|
24
24
|
let descriptionStyle = {};
|
|
@@ -146,7 +146,11 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
146
146
|
styles.container,
|
|
147
147
|
{backgroundColor: theme.colors.background.surface},
|
|
148
148
|
]}>
|
|
149
|
-
{!!image &&
|
|
149
|
+
{!!image && (
|
|
150
|
+
<View style={styles.image}>
|
|
151
|
+
<Image source={{uri: image}} />
|
|
152
|
+
</View>
|
|
153
|
+
)}
|
|
150
154
|
<View style={styles.content}>
|
|
151
155
|
<Text typography={'title_xs'} numberOfLines={1}>
|
|
152
156
|
{title}
|
|
@@ -164,13 +168,14 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
164
168
|
{description}
|
|
165
169
|
</Text>
|
|
166
170
|
</Description>
|
|
167
|
-
{!!
|
|
171
|
+
{!!error && (
|
|
168
172
|
<View style={styles.information}>
|
|
169
173
|
<Text
|
|
170
174
|
typography={'description_xs'}
|
|
171
175
|
color={theme.colors.text.hint}
|
|
172
176
|
numberOfLines={1}>
|
|
173
|
-
{
|
|
177
|
+
{translate?.('errorCode')}
|
|
178
|
+
{error}
|
|
174
179
|
</Text>
|
|
175
180
|
</View>
|
|
176
181
|
)}
|
|
@@ -190,6 +195,7 @@ const styles = StyleSheet.create({
|
|
|
190
195
|
borderTopLeftRadius: Radius.L,
|
|
191
196
|
borderTopRightRadius: Radius.L,
|
|
192
197
|
aspectRatio: 1.7777,
|
|
198
|
+
overflow: 'hidden',
|
|
193
199
|
},
|
|
194
200
|
content: {padding: Spacing.XL},
|
|
195
201
|
description: {
|
package/Popup/PopupPromotion.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import {Image} from '../Image';
|
|
|
6
6
|
import {Radius, Spacing} from '../Consts';
|
|
7
7
|
import {Icon} from '../Icon';
|
|
8
8
|
|
|
9
|
-
const PopupPromotion: React.FC<PopupPromotionProps> = ({image,
|
|
9
|
+
const PopupPromotion: React.FC<PopupPromotionProps> = ({image, onIconClose}) => {
|
|
10
10
|
const {theme, navigator} = useContext(ApplicationContext);
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -18,7 +18,7 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({image, onClose}) => {
|
|
|
18
18
|
<TouchableOpacity
|
|
19
19
|
onPress={() => {
|
|
20
20
|
navigator?.pop();
|
|
21
|
-
|
|
21
|
+
onIconClose?.();
|
|
22
22
|
}}
|
|
23
23
|
style={styles.iconButton}>
|
|
24
24
|
<View
|
|
@@ -42,12 +42,13 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({image, onClose}) => {
|
|
|
42
42
|
|
|
43
43
|
return (
|
|
44
44
|
<View accessibilityLabel={'PopupPromotion'}>
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
<View style={styles.container}>
|
|
46
|
+
<Image
|
|
47
|
+
source={{
|
|
48
|
+
uri: image,
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
51
|
+
</View>
|
|
51
52
|
{buildCloseIcon()}
|
|
52
53
|
</View>
|
|
53
54
|
);
|
package/Popup/types.ts
CHANGED
|
@@ -18,9 +18,9 @@ export type PopupNotifyProps = {
|
|
|
18
18
|
description: string | React.ReactNode;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* `
|
|
21
|
+
* `error`: Optional. Represents additional error text to be displayed in the PopupNotify component.
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
error?: string;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* `secondary`: Optional. Represents the secondary action that can be performed from the PopupNotify component.
|
|
@@ -55,7 +55,7 @@ export type PopupPromotionProps = {
|
|
|
55
55
|
/**
|
|
56
56
|
* `onClose`: Optional. A callback function that is called when the PopupPromotion component is closed.
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
onIconClose?: () => void;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
type PopupAction = {
|