@momo-kits/foundation 0.156.1-tracking.9 → 0.157.1-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/BottomTab/BottomTabBar.tsx +2 -1
- package/Application/BottomTab/CustomBottomTabItem.tsx +2 -2
- package/Application/BottomTab/index.tsx +1 -1
- package/Application/ModalScreen.tsx +4 -21
- package/Popup/PopupNotify.tsx +2 -33
- package/Popup/PopupPromotion.tsx +1 -31
- package/package.json +34 -34
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import { TouchableOpacity, StyleSheet
|
|
2
|
+
import { TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
BottomTabBarButtonProps,
|
|
5
5
|
BottomTabNavigationOptions,
|
|
@@ -143,7 +143,7 @@ const styles = StyleSheet.create({
|
|
|
143
143
|
alignItems: 'center',
|
|
144
144
|
justifyContent: 'center',
|
|
145
145
|
paddingVertical: 8,
|
|
146
|
-
bottom:
|
|
146
|
+
bottom: -2,
|
|
147
147
|
},
|
|
148
148
|
label: {
|
|
149
149
|
fontSize: 12,
|
|
@@ -19,18 +19,6 @@ import BottomSheet from './BottomSheet';
|
|
|
19
19
|
import { runOnJS } from 'react-native-reanimated';
|
|
20
20
|
|
|
21
21
|
const ModalScreen: React.FC<any> = props => {
|
|
22
|
-
const context: any = useContext(MiniAppContext);
|
|
23
|
-
const { navigator } = useContext(ApplicationContext);
|
|
24
|
-
|
|
25
|
-
useEffect(
|
|
26
|
-
() => {
|
|
27
|
-
if (context?.enableHapticDialog) {
|
|
28
|
-
navigator?.maxApi?.triggerEventVibration?.('light');
|
|
29
|
-
}
|
|
30
|
-
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
|
-
[],
|
|
32
|
-
);
|
|
33
|
-
|
|
34
22
|
if (props.route?.params?.isBottomSheet) {
|
|
35
23
|
return <BottomSheet {...props} />;
|
|
36
24
|
}
|
|
@@ -40,6 +28,7 @@ const ModalScreen: React.FC<any> = props => {
|
|
|
40
28
|
const Modal: React.FC<ModalParams> = props => {
|
|
41
29
|
const { navigator } = useContext(ApplicationContext);
|
|
42
30
|
const context = useContext<any>(MiniAppContext);
|
|
31
|
+
const modalParams = useRef<any>(undefined);
|
|
43
32
|
const {
|
|
44
33
|
screen,
|
|
45
34
|
barrierDismissible,
|
|
@@ -61,14 +50,9 @@ const Modal: React.FC<ModalParams> = props => {
|
|
|
61
50
|
Container = ModalRN;
|
|
62
51
|
}
|
|
63
52
|
|
|
64
|
-
let modalParams = {
|
|
65
|
-
title: '',
|
|
66
|
-
description: '',
|
|
67
|
-
};
|
|
68
|
-
|
|
69
53
|
if (screen != null) {
|
|
70
54
|
const screenProps = screen?.()?.props || {};
|
|
71
|
-
modalParams = {
|
|
55
|
+
modalParams.current = {
|
|
72
56
|
title: screenProps?.title || '',
|
|
73
57
|
description: screenProps?.description || '',
|
|
74
58
|
};
|
|
@@ -78,14 +62,13 @@ const Modal: React.FC<ModalParams> = props => {
|
|
|
78
62
|
const item: any = {
|
|
79
63
|
screenName: params.screen,
|
|
80
64
|
componentName: 'Modal',
|
|
81
|
-
|
|
82
|
-
modalDescription: modalParams.description,
|
|
65
|
+
...modalParams.current,
|
|
83
66
|
};
|
|
84
67
|
context?.autoTracking?.({
|
|
85
68
|
...context,
|
|
86
69
|
...item,
|
|
87
70
|
});
|
|
88
|
-
}, []);
|
|
71
|
+
}, [context, params.screen]);
|
|
89
72
|
|
|
90
73
|
useEffect(() => {
|
|
91
74
|
Animated.parallel([
|
package/Popup/PopupNotify.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext,
|
|
1
|
+
import React, { useContext, useRef, useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Dimensions,
|
|
4
4
|
ScrollView,
|
|
@@ -11,12 +11,11 @@ import { Button } from '../Button';
|
|
|
11
11
|
import { Colors, Radius, Spacing, Styles } from '../Consts';
|
|
12
12
|
import { Icon } from '../Icon';
|
|
13
13
|
import { Image } from '../Image';
|
|
14
|
-
import {
|
|
14
|
+
import { Text, useScaleSize } from '../Text';
|
|
15
15
|
import { PopupNotifyProps } from './types';
|
|
16
16
|
import { runOnJS } from 'react-native-reanimated';
|
|
17
17
|
|
|
18
18
|
const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
19
|
-
id,
|
|
20
19
|
image,
|
|
21
20
|
title = 'Title',
|
|
22
21
|
description = 'Description',
|
|
@@ -41,36 +40,6 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
41
40
|
Description = ScrollView;
|
|
42
41
|
descriptionStyle = { maxHeight: scaledMaxHeight };
|
|
43
42
|
}
|
|
44
|
-
/**
|
|
45
|
-
* tracking
|
|
46
|
-
*/
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
const routes = navigator?.ref.current?.getRootState()?.routes || [];
|
|
49
|
-
const routesLength = routes.length;
|
|
50
|
-
let screen_name = routes?.[0]?.params?.screen?.name;
|
|
51
|
-
if (routesLength > 1) {
|
|
52
|
-
screen_name = routes[routesLength - 2]?.params?.screen?.name;
|
|
53
|
-
}
|
|
54
|
-
const tracking = {
|
|
55
|
-
...context,
|
|
56
|
-
screen_name,
|
|
57
|
-
component_type: 'popup',
|
|
58
|
-
component_name: id,
|
|
59
|
-
error_code: error ? error : undefined,
|
|
60
|
-
};
|
|
61
|
-
navigator?.maxApi?.trackEvent?.('service_component_displayed', {
|
|
62
|
-
...tracking,
|
|
63
|
-
trigger_id: '111012100000000000',
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
return () => {
|
|
67
|
-
navigator?.maxApi?.trackEvent?.('service_popup_dismissed', {
|
|
68
|
-
...tracking,
|
|
69
|
-
trigger_id: '111154100000000001',
|
|
70
|
-
action_type: closeAction.current,
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
}, [context, error, id, navigator?.maxApi, navigator?.ref]);
|
|
74
43
|
|
|
75
44
|
/**
|
|
76
45
|
* on action popup
|
package/Popup/PopupPromotion.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext,
|
|
1
|
+
import React, { useContext, useRef } from 'react';
|
|
2
2
|
import { Dimensions, StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
3
3
|
import { PopupPromotionProps } from './types';
|
|
4
4
|
import { ApplicationContext, MiniAppContext } from '../Context';
|
|
@@ -7,7 +7,6 @@ import { Colors, Radius, Spacing } from '../Consts';
|
|
|
7
7
|
import { Icon } from '../Icon';
|
|
8
8
|
|
|
9
9
|
const PopupPromotion: React.FC<PopupPromotionProps> = ({
|
|
10
|
-
id,
|
|
11
10
|
image,
|
|
12
11
|
onIconClose,
|
|
13
12
|
onRequestClose,
|
|
@@ -20,35 +19,6 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({
|
|
|
20
19
|
|
|
21
20
|
const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
|
|
22
21
|
|
|
23
|
-
/**
|
|
24
|
-
* tracking
|
|
25
|
-
*/
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
const routes = navigator?.ref.current?.getRootState()?.routes || [];
|
|
28
|
-
const routesLength = routes.length;
|
|
29
|
-
let screen_name = routes?.[0]?.params?.screen?.name;
|
|
30
|
-
if (routesLength > 1) {
|
|
31
|
-
screen_name = routes[routesLength - 2]?.params?.screen?.name;
|
|
32
|
-
}
|
|
33
|
-
const tracking = {
|
|
34
|
-
...context,
|
|
35
|
-
screen_name,
|
|
36
|
-
component_type: 'popup',
|
|
37
|
-
component_name: id,
|
|
38
|
-
};
|
|
39
|
-
navigator?.maxApi?.trackEvent?.('service_component_displayed', {
|
|
40
|
-
...tracking,
|
|
41
|
-
trigger_id: '111012100000000000',
|
|
42
|
-
});
|
|
43
|
-
return () => {
|
|
44
|
-
navigator?.maxApi?.trackEvent?.('service_popup_dismissed', {
|
|
45
|
-
...tracking,
|
|
46
|
-
trigger_id: '111154100000000001',
|
|
47
|
-
action_type: closeAction.current,
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
}, [context, id, navigator?.maxApi, navigator?.ref]);
|
|
51
|
-
|
|
52
22
|
/**
|
|
53
23
|
* on action popup
|
|
54
24
|
* @param callback
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
2
|
+
"name": "@momo-kits/foundation",
|
|
3
|
+
"version": "0.157.1-beta.1",
|
|
4
|
+
"description": "React Native Component Kits",
|
|
5
|
+
"main": "index.ts",
|
|
6
|
+
"scripts": {},
|
|
7
|
+
"keywords": [
|
|
8
|
+
"@momo-kits/foundation"
|
|
9
|
+
],
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"react-native-fast-image": "git+https://oauth2:TGi6oBj-LdzsKpLXQSoH@gitlab.mservice.com.vn/momo-platform/public/react-native-fast-image.git#v8.11.0",
|
|
12
|
+
"@react-navigation/bottom-tabs": "7.4.2",
|
|
13
|
+
"@react-navigation/core": "7.12.1",
|
|
14
|
+
"@react-navigation/elements": "2.5.2",
|
|
15
|
+
"@react-navigation/native": "7.1.14",
|
|
16
|
+
"@react-navigation/routers": "7.4.1",
|
|
17
|
+
"@react-navigation/stack": "7.4.2",
|
|
18
|
+
"react-native-gesture-handler": "2.27.1",
|
|
19
|
+
"react-native-linear-gradient": "git+https://oauth2:TGi6oBj-LdzsKpLXQSoH@gitlab.mservice.com.vn/momo-platform/public/react-native-linear-gradient#v3.0.0",
|
|
20
|
+
"react-native-reanimated": "4.1.0",
|
|
21
|
+
"react-native-safe-area-context": "5.5.2",
|
|
22
|
+
"@shopify/flash-list": "2.1.0",
|
|
23
|
+
"lottie-react-native": "7.2.4"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"react-native": "*"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/color": "3.0.6"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"registry": "https://registry.npmjs.org/"
|
|
33
|
+
},
|
|
34
|
+
"license": "MoMo"
|
|
35
|
+
}
|