@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.
@@ -298,7 +298,8 @@ const styles = StyleSheet.create({
298
298
  alignItems: 'center',
299
299
  left: 0,
300
300
  right: 0,
301
- bottom: Platform.OS === 'ios' ? -6 : 4,
301
+ top: -2,
302
+ bottom: Platform.OS === 'ios' ? -6 : 4
302
303
  },
303
304
  floatingContent: {
304
305
  alignItems: 'center',
@@ -1,5 +1,5 @@
1
1
  import React, { useContext } from 'react';
2
- import { TouchableOpacity, StyleSheet, Platform } from 'react-native';
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: Platform.OS === 'ios' ? 8 : -2,
146
+ bottom: -2,
147
147
  },
148
148
  label: {
149
149
  fontSize: 12,
@@ -389,7 +389,7 @@ const BottomTab: React.FC<BottomTabProps> = ({
389
389
  title: item.label,
390
390
  tabBarStyle: [
391
391
  {
392
- height: 64 + Math.min(insets.bottom, 21),
392
+ height: 64,
393
393
  },
394
394
  styles.tabStyle,
395
395
  ],
@@ -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
- modalTitle: modalParams.title,
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([
@@ -1,4 +1,4 @@
1
- import React, { useContext, useEffect, useRef, useState } from 'react';
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 { useScaleSize, Text } from '../Text';
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
@@ -1,4 +1,4 @@
1
- import React, { useContext, useEffect, useRef } from 'react';
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
- "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
- }
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
+ }