@momo-kits/foundation 0.81.22 → 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}
@@ -159,19 +159,6 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
159
159
 
160
160
  const goBack = () => {
161
161
  const canGoBack = navigator?.ref.current?.canGoBack();
162
- const currentRoute = navigator?.ref?.current.getCurrentRoute();
163
-
164
- if (navigator?.trackingInfo) {
165
- navigator?.maxApi?.trackEvent('service_icon_clicked', {
166
- feature_code: navigator.trackingInfo.code,
167
- app_id: navigator.trackingInfo.appId,
168
- miniapp_version: navigator.trackingInfo.buildNumber,
169
- flow_partner_id: navigator.trackingInfo.flowPartnerId,
170
- screen_name: currentRoute?.params?.screen?.name ?? currentRoute?.name,
171
- trigger_id: '111154000000000000',
172
- icon_name: 'back',
173
- });
174
- }
175
162
 
176
163
  if (canGoBack) {
177
164
  if (preventBack) {
@@ -247,6 +234,8 @@ const HeaderBackground: React.FC<HeaderBackgroundProps> = ({
247
234
  ]}>
248
235
  <StatusBar
249
236
  barStyle={headerImage || theme.dark ? 'light-content' : 'dark-content'}
237
+ translucent={true}
238
+ backgroundColor={'transparent'}
250
239
  />
251
240
  {!!headerImage && (
252
241
  <Image
@@ -32,21 +32,34 @@ const StackScreen: React.FC<ScreenParams> = props => {
32
32
  */
33
33
  useEffect(() => {
34
34
  if (navigator?.trackingInfo) {
35
+ const tracking = {
36
+ feature_code: navigator.trackingInfo.code,
37
+ app_id: navigator.trackingInfo.appId,
38
+ miniapp_version: navigator.trackingInfo.buildNumber,
39
+ flow_partner_id: navigator.trackingInfo.flowPartnerId,
40
+ screen_name: Component.name,
41
+ };
42
+
35
43
  const routes = props.navigation.getState()?.routes || [];
36
44
  const routesLength = routes.length;
37
45
  let pre_screen_name = '';
38
46
  if (routesLength > 1) {
39
47
  pre_screen_name = routes[routesLength - 2]?.params?.screen?.name;
40
48
  }
49
+
41
50
  navigator?.maxApi?.trackEvent('service_frame_displayed', {
42
- feature_code: navigator.trackingInfo.code,
43
- app_id: navigator.trackingInfo.appId,
44
- miniapp_version: navigator.trackingInfo.buildNumber,
45
- flow_partner_id: navigator.trackingInfo.flowPartnerId,
46
- screen_name: Component.name,
51
+ ...tracking,
47
52
  pre_screen_name,
48
53
  trigger_id: '111378000000000000',
49
54
  });
55
+
56
+ return () => {
57
+ navigator?.maxApi?.trackEvent('service_icon_clicked', {
58
+ ...tracking,
59
+ trigger_id: '111154000000000000',
60
+ icon_name: 'back',
61
+ });
62
+ };
50
63
  }
51
64
  }, []);
52
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>
package/Layout/Screen.tsx CHANGED
@@ -108,8 +108,13 @@ const Screen = forwardRef(
108
108
  let handleScroll;
109
109
  let headerBackground: string | undefined = undefined;
110
110
  let Component: any = View;
111
+ let keyboardVerticalOffset = heightHeader - 20;
111
112
  animatedValue.current = undefined;
112
113
 
114
+ if (useExtendedHeader || animatedHeader) {
115
+ keyboardVerticalOffset = -20;
116
+ }
117
+
113
118
  if (useExtendedHeader) {
114
119
  headerBackground = theme.assets?.headerBackground;
115
120
  }
@@ -267,7 +272,7 @@ const Screen = forwardRef(
267
272
  <KeyboardAvoidingView
268
273
  style={Styles.flex}
269
274
  enabled={enableKeyboardAvoidingView}
270
- keyboardVerticalOffset={heightHeader - 20}
275
+ keyboardVerticalOffset={keyboardVerticalOffset}
271
276
  behavior={Platform.select({
272
277
  ios: 'padding',
273
278
  android: undefined,
@@ -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,
@@ -71,11 +48,28 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
71
48
  screen_name,
72
49
  component_type: 'popup',
73
50
  component_name: 'PopupNotify',
74
- error_code: error,
75
- trigger_id,
76
- action_type: actionType,
51
+ error_code: error ? error : undefined,
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
  /**
@@ -206,7 +200,6 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
206
200
  <Description style={[styles.description, descriptionStyle]}>
207
201
  <Text
208
202
  typography={'paragraph_default'}
209
- numberOfLines={4}
210
203
  onTextLayout={({nativeEvent: {lines}}) => {
211
204
  const enableScroll = lines.length > 3;
212
205
  if (enableScroll != scrollContent) {
package/Text/index.tsx CHANGED
@@ -88,6 +88,7 @@ const Text: React.FC<TextProps> = ({
88
88
  fontSize: scaleSize(fontSize),
89
89
  lineHeight: scaleSize(lineHeight),
90
90
  fontStyle,
91
+ fontWeight,
91
92
  };
92
93
  };
93
94
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.81.22",
3
+ "version": "0.81.23-beta.2",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {