@momo-kits/foundation 0.81.23-beta.1 → 0.81.23-beta.2

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>
@@ -33,29 +33,6 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
33
33
  * tracking
34
34
  */
35
35
  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
36
  if (navigator?.trackingInfo) {
60
37
  const routes = navigator.ref.current?.getRootState()?.routes || [];
61
38
  const routesLength = routes.length;
@@ -63,7 +40,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
63
40
  if (routesLength > 1) {
64
41
  screen_name = routes[routesLength - 2]?.params?.screen?.name;
65
42
  }
66
- navigator?.maxApi?.trackEvent(event, {
43
+ const tracking = {
67
44
  feature_code: navigator?.trackingInfo?.code,
68
45
  app_id: navigator?.trackingInfo?.appId,
69
46
  miniapp_version: navigator?.trackingInfo?.buildNumber,
@@ -72,10 +49,27 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
72
49
  component_type: 'popup',
73
50
  component_name: 'PopupNotify',
74
51
  error_code: error ? error : undefined,
75
- trigger_id,
76
- action_type: actionType,
52
+ };
53
+ navigator?.maxApi?.trackEvent('service_component_displayed', {
54
+ ...tracking,
55
+ trigger_id: '111012100000000000',
77
56
  });
57
+ return () => {
58
+ navigator?.maxApi?.trackEvent('service_popup_dismissed', {
59
+ ...tracking,
60
+ trigger_id: '111154100000000001',
61
+ action_type: closeAction.current,
62
+ });
63
+ };
78
64
  }
65
+ }, []);
66
+ /**
67
+ * on action popup
68
+ * @param callback
69
+ */
70
+ const onAction = (callback?: () => void) => {
71
+ navigator?.pop();
72
+ callback?.();
79
73
  };
80
74
 
81
75
  /**
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.2",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {