@momo-kits/foundation 0.156.1-beta.9 → 0.156.1-tracking.9

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.
@@ -39,6 +39,7 @@ const ModalScreen: React.FC<any> = props => {
39
39
 
40
40
  const Modal: React.FC<ModalParams> = props => {
41
41
  const { navigator } = useContext(ApplicationContext);
42
+ const context = useContext<any>(MiniAppContext);
42
43
  const {
43
44
  screen,
44
45
  barrierDismissible,
@@ -60,6 +61,32 @@ const Modal: React.FC<ModalParams> = props => {
60
61
  Container = ModalRN;
61
62
  }
62
63
 
64
+ let modalParams = {
65
+ title: '',
66
+ description: '',
67
+ };
68
+
69
+ if (screen != null) {
70
+ const screenProps = screen?.()?.props || {};
71
+ modalParams = {
72
+ title: screenProps?.title || '',
73
+ description: screenProps?.description || '',
74
+ };
75
+ }
76
+
77
+ useEffect(() => {
78
+ const item: any = {
79
+ screenName: params.screen,
80
+ componentName: 'Modal',
81
+ modalTitle: modalParams.title,
82
+ modalDescription: modalParams.description,
83
+ };
84
+ context?.autoTracking?.({
85
+ ...context,
86
+ ...item,
87
+ });
88
+ }, []);
89
+
63
90
  useEffect(() => {
64
91
  Animated.parallel([
65
92
  Animated.timing(opacity, {
@@ -80,27 +107,30 @@ const Modal: React.FC<ModalParams> = props => {
80
107
  };
81
108
  }, [opacity, props.route.params, scale]);
82
109
 
83
- const onDismiss = useCallback((callback = () => {}, preventClose = false) => {
84
- if (preventClose) {
85
- return;
86
- }
87
- Animated.parallel([
88
- Animated.timing(opacity, {
89
- toValue: 0,
90
- duration: 200,
91
- useNativeDriver: true,
92
- }),
93
- Animated.timing(scale, {
94
- toValue: 0.8,
95
- duration: 200,
96
- easing: Easing.linear,
97
- useNativeDriver: true,
98
- }),
99
- ]).start(() => {
100
- navigator?.pop();
101
- runOnJS(callback)();
102
- });
103
- }, [navigator, opacity, scale]);
110
+ const onDismiss = useCallback(
111
+ (callback = () => {}, preventClose = false) => {
112
+ if (preventClose) {
113
+ return;
114
+ }
115
+ Animated.parallel([
116
+ Animated.timing(opacity, {
117
+ toValue: 0,
118
+ duration: 200,
119
+ useNativeDriver: true,
120
+ }),
121
+ Animated.timing(scale, {
122
+ toValue: 0.8,
123
+ duration: 200,
124
+ easing: Easing.linear,
125
+ useNativeDriver: true,
126
+ }),
127
+ ]).start(() => {
128
+ navigator?.pop();
129
+ runOnJS(callback)();
130
+ });
131
+ },
132
+ [navigator, opacity, scale],
133
+ );
104
134
 
105
135
  useEffect(() => {
106
136
  const backHandler = BackHandler.addEventListener(
@@ -106,6 +106,7 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({
106
106
  source={{
107
107
  uri: image,
108
108
  }}
109
+ resizeMode="contain"
109
110
  style={[
110
111
  styles.container,
111
112
  {
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
1
  {
2
- "name": "@momo-kits/foundation",
3
- "version": "0.156.1-beta.9",
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
- }
2
+ "name": "@momo-kits/foundation",
3
+ "version": "0.156.1-tracking.9",
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
+ }