@momo-kits/foundation 0.81.23-beta.2 → 0.81.23-beta.4
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/Popup/PopupNotify.tsx +3 -1
- package/Popup/PopupPromotion.tsx +15 -20
- package/Popup/types.ts +9 -0
- package/package.json +1 -1
package/Popup/PopupNotify.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import {Button} from '../Button';
|
|
|
9
9
|
import {Icon} from '../Icon';
|
|
10
10
|
|
|
11
11
|
const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
12
|
+
id,
|
|
12
13
|
image,
|
|
13
14
|
title = 'Title',
|
|
14
15
|
description = 'Description',
|
|
@@ -47,7 +48,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
47
48
|
flow_partner_id: navigator?.trackingInfo?.flowPartnerId,
|
|
48
49
|
screen_name,
|
|
49
50
|
component_type: 'popup',
|
|
50
|
-
component_name:
|
|
51
|
+
component_name: id,
|
|
51
52
|
error_code: error ? error : undefined,
|
|
52
53
|
};
|
|
53
54
|
navigator?.maxApi?.trackEvent('service_component_displayed', {
|
|
@@ -63,6 +64,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
63
64
|
};
|
|
64
65
|
}
|
|
65
66
|
}, []);
|
|
67
|
+
|
|
66
68
|
/**
|
|
67
69
|
* on action popup
|
|
68
70
|
* @param callback
|
package/Popup/PopupPromotion.tsx
CHANGED
|
@@ -7,6 +7,7 @@ import {Radius, Spacing} from '../Consts';
|
|
|
7
7
|
import {Icon} from '../Icon';
|
|
8
8
|
|
|
9
9
|
const PopupPromotion: React.FC<PopupPromotionProps> = ({
|
|
10
|
+
id,
|
|
10
11
|
image,
|
|
11
12
|
onIconClose,
|
|
12
13
|
}) => {
|
|
@@ -17,21 +18,6 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({
|
|
|
17
18
|
* tracking
|
|
18
19
|
*/
|
|
19
20
|
useEffect(() => {
|
|
20
|
-
onTracking('service_component_displayed', undefined, '111012100000000000');
|
|
21
|
-
return () => {
|
|
22
|
-
onTracking(
|
|
23
|
-
'service_popup_dismissed',
|
|
24
|
-
closeAction.current,
|
|
25
|
-
'111154100000000001',
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
}, []);
|
|
29
|
-
|
|
30
|
-
const onTracking = (
|
|
31
|
-
event: string,
|
|
32
|
-
actionType: string | undefined,
|
|
33
|
-
trigger_id: string,
|
|
34
|
-
) => {
|
|
35
21
|
if (navigator?.trackingInfo) {
|
|
36
22
|
const routes = navigator.ref.current?.getRootState()?.routes || [];
|
|
37
23
|
const routesLength = routes.length;
|
|
@@ -39,19 +25,28 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({
|
|
|
39
25
|
if (routesLength > 1) {
|
|
40
26
|
screen_name = routes[routesLength - 2]?.params?.screen?.name;
|
|
41
27
|
}
|
|
42
|
-
|
|
28
|
+
const tracking = {
|
|
43
29
|
feature_code: navigator?.trackingInfo?.code,
|
|
44
30
|
app_id: navigator?.trackingInfo?.appId,
|
|
45
31
|
miniapp_version: navigator?.trackingInfo?.buildNumber,
|
|
46
32
|
flow_partner_id: navigator?.trackingInfo?.flowPartnerId,
|
|
47
33
|
screen_name,
|
|
48
34
|
component_type: 'popup',
|
|
49
|
-
component_name:
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
component_name: id,
|
|
36
|
+
};
|
|
37
|
+
navigator?.maxApi?.trackEvent('service_component_displayed', {
|
|
38
|
+
...tracking,
|
|
39
|
+
trigger_id: '111012100000000000',
|
|
52
40
|
});
|
|
41
|
+
return () => {
|
|
42
|
+
navigator?.maxApi?.trackEvent('service_popup_dismissed', {
|
|
43
|
+
...tracking,
|
|
44
|
+
trigger_id: '111154100000000001',
|
|
45
|
+
action_type: closeAction.current,
|
|
46
|
+
});
|
|
47
|
+
};
|
|
53
48
|
}
|
|
54
|
-
};
|
|
49
|
+
}, []);
|
|
55
50
|
|
|
56
51
|
/**
|
|
57
52
|
* build close action
|
package/Popup/types.ts
CHANGED
|
@@ -2,6 +2,10 @@ import {TextStyle} from 'react-native';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
export type PopupNotifyProps = {
|
|
5
|
+
/**
|
|
6
|
+
* `id`: Optional. id component_name for tracking component.
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
5
9
|
/**
|
|
6
10
|
* `image`: Optional. Represents the URL or path of the image to be displayed in the PopupNotify component.
|
|
7
11
|
*/
|
|
@@ -47,6 +51,11 @@ export type PopupNotifyProps = {
|
|
|
47
51
|
};
|
|
48
52
|
|
|
49
53
|
export type PopupPromotionProps = {
|
|
54
|
+
/**
|
|
55
|
+
* `id`: Optional. id component_name for tracking component.
|
|
56
|
+
*/
|
|
57
|
+
id?: string;
|
|
58
|
+
|
|
50
59
|
/**
|
|
51
60
|
* `image`: Represents the URL or path of the image to be displayed in the PopupPromotion component.
|
|
52
61
|
*/
|