@momo-kits/foundation 0.81.23-beta.1 → 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.
@@ -41,6 +41,7 @@ const BottomTab: React.FC<BottomTabProps> = ({
41
41
  return (
42
42
  <View style={{paddingHorizontal: 16}}>
43
43
  <Text
44
+ numberOfLines={1}
44
45
  typography={focused ? 'label_xs' : 'description_xs'}
45
46
  color={color}>
46
47
  {item.label}
@@ -234,6 +234,8 @@ const HeaderBackground: React.FC<HeaderBackgroundProps> = ({
234
234
  ]}>
235
235
  <StatusBar
236
236
  barStyle={headerImage || theme.dark ? 'light-content' : 'dark-content'}
237
+ translucent={true}
238
+ backgroundColor={'transparent'}
237
239
  />
238
240
  {!!headerImage && (
239
241
  <Image
@@ -6,7 +6,6 @@ import {
6
6
  Platform,
7
7
  Pressable,
8
8
  StyleSheet,
9
- TouchableHighlight,
10
9
  View,
11
10
  } from 'react-native';
12
11
  import {SafeAreaView, useSafeAreaInsets} from 'react-native-safe-area-context';
@@ -191,11 +190,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
191
190
  ...theme,
192
191
  assets: {...theme.assets, headerBackground: undefined},
193
192
  }}
194
- screen={props => (
195
- <TouchableHighlight style={Styles.flex}>
196
- <Component {...props} {...params} />
197
- </TouchableHighlight>
198
- )}
193
+ screen={props => <Component {...props} {...params} />}
199
194
  options={{
200
195
  ...options,
201
196
  ...{
@@ -53,13 +53,13 @@ const StackScreen: React.FC<ScreenParams> = props => {
53
53
  trigger_id: '111378000000000000',
54
54
  });
55
55
 
56
- return props.navigation.addListener('beforeRemove', () => {
56
+ return () => {
57
57
  navigator?.maxApi?.trackEvent('service_icon_clicked', {
58
58
  ...tracking,
59
59
  trigger_id: '111154000000000000',
60
60
  icon_name: 'back',
61
61
  });
62
- });
62
+ };
63
63
  }
64
64
  }, []);
65
65
 
package/Layout/Card.tsx CHANGED
@@ -140,6 +140,18 @@ const Card: React.FC<CardProps> = ({
140
140
  const {theme} = useContext(ApplicationContext);
141
141
  return (
142
142
  <GridContext.Provider value={gridContext}>
143
+ {!!backgroundImage && (
144
+ <Image
145
+ source={{uri: backgroundImage}}
146
+ style={[
147
+ styles.imageBackground,
148
+ {
149
+ width: widthSection,
150
+ marginHorizontal: margin,
151
+ },
152
+ ]}
153
+ />
154
+ )}
143
155
  <View
144
156
  accessibilityLabel={`Card`}
145
157
  style={[
@@ -149,16 +161,12 @@ const Card: React.FC<CardProps> = ({
149
161
  {
150
162
  width: widthSection,
151
163
  marginHorizontal: margin,
152
- backgroundColor: theme.colors.background.surface,
164
+ backgroundColor: backgroundImage
165
+ ? undefined
166
+ : theme.colors.background.surface,
153
167
  },
154
168
  useShadow && Shadow.Light,
155
169
  ]}>
156
- {!!backgroundImage && (
157
- <Image
158
- source={{uri: backgroundImage}}
159
- style={styles.imageBackground}
160
- />
161
- )}
162
170
  {renderView(validateChildren(children, [Item, ItemList]))}
163
171
  {showGrid && renderOverlay()}
164
172
  </View>
@@ -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',
@@ -33,29 +34,6 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
33
34
  * tracking
34
35
  */
35
36
  useEffect(() => {
36
- onTracking('service_component_displayed', undefined, '111012100000000000');
37
- return () => {
38
- onTracking(
39
- 'service_popup_dismissed',
40
- closeAction.current,
41
- '111154100000000001',
42
- );
43
- };
44
- }, []);
45
- /**
46
- * on action popup
47
- * @param callback
48
- */
49
- const onAction = (callback?: () => void) => {
50
- navigator?.pop();
51
- callback?.();
52
- };
53
-
54
- const onTracking = (
55
- event: string,
56
- actionType: string | undefined,
57
- trigger_id: string,
58
- ) => {
59
37
  if (navigator?.trackingInfo) {
60
38
  const routes = navigator.ref.current?.getRootState()?.routes || [];
61
39
  const routesLength = routes.length;
@@ -63,19 +41,37 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
63
41
  if (routesLength > 1) {
64
42
  screen_name = routes[routesLength - 2]?.params?.screen?.name;
65
43
  }
66
- navigator?.maxApi?.trackEvent(event, {
44
+ const tracking = {
67
45
  feature_code: navigator?.trackingInfo?.code,
68
46
  app_id: navigator?.trackingInfo?.appId,
69
47
  miniapp_version: navigator?.trackingInfo?.buildNumber,
70
48
  flow_partner_id: navigator?.trackingInfo?.flowPartnerId,
71
49
  screen_name,
72
50
  component_type: 'popup',
73
- component_name: 'PopupNotify',
51
+ component_name: id,
74
52
  error_code: error ? error : undefined,
75
- trigger_id,
76
- action_type: actionType,
53
+ };
54
+ navigator?.maxApi?.trackEvent('service_component_displayed', {
55
+ ...tracking,
56
+ trigger_id: '111012100000000000',
77
57
  });
58
+ return () => {
59
+ navigator?.maxApi?.trackEvent('service_popup_dismissed', {
60
+ ...tracking,
61
+ trigger_id: '111154100000000001',
62
+ action_type: closeAction.current,
63
+ });
64
+ };
78
65
  }
66
+ }, []);
67
+
68
+ /**
69
+ * on action popup
70
+ * @param callback
71
+ */
72
+ const onAction = (callback?: () => void) => {
73
+ navigator?.pop();
74
+ callback?.();
79
75
  };
80
76
 
81
77
  /**
@@ -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
- navigator?.maxApi?.trackEvent(event, {
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: 'PopupPromotion',
50
- trigger_id,
51
- action_type: actionType,
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
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.81.23-beta.1",
3
+ "version": "0.81.23-beta.4",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {