@momo-kits/foundation 0.81.14 → 0.81.17

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.
@@ -169,6 +169,7 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
169
169
  feature_code: navigator.trackingInfo.code,
170
170
  app_id: navigator.trackingInfo.appId,
171
171
  miniapp_version: navigator.trackingInfo.buildNumber,
172
+ flow_partner_id: navigator.trackingInfo.flowPartnerId,
172
173
  screen_name: currentRoute?.params?.screen?.name ?? currentRoute?.name,
173
174
  trigger_id: '111154000000000000',
174
175
  icon_name: 'back',
@@ -69,6 +69,7 @@ const Modal: React.FC<ModalParams> = props => {
69
69
  feature_code: navigator.trackingInfo.code,
70
70
  app_id: navigator.trackingInfo.appId,
71
71
  miniapp_version: navigator.trackingInfo.buildNumber,
72
+ flow_partner_id: navigator.trackingInfo.flowPartnerId,
72
73
  screen_name,
73
74
  trigger_id: '111012100000000000',
74
75
  component_type: 'popup',
@@ -43,6 +43,7 @@ const StackScreen: React.FC<ScreenParams> = props => {
43
43
  feature_code: navigator.trackingInfo.code,
44
44
  app_id: navigator.trackingInfo.appId,
45
45
  miniapp_version: navigator.trackingInfo.buildNumber,
46
+ flow_partner_id: navigator.trackingInfo.flowPartnerId,
46
47
  screen_name: Component.name,
47
48
  pre_screen_name,
48
49
  trigger_id: '111378000000000000',
@@ -84,6 +84,7 @@ export type TrackingInfo = {
84
84
  code: string;
85
85
  appId: string;
86
86
  buildNumber: number;
87
+ flowPartnerId?: string;
87
88
  };
88
89
 
89
90
  export type NavigationContainerProps = {
package/Image/index.tsx CHANGED
@@ -1,28 +1,16 @@
1
1
  import React, {useContext, useRef, useState} from 'react';
2
- import {StyleProp, StyleSheet, View, ViewStyle} from 'react-native';
2
+ import {StyleSheet, View} from 'react-native';
3
3
  import FastImage from 'react-native-fast-image';
4
4
  import styles from './styles';
5
5
  import {ApplicationContext} from '../Application';
6
6
  import {Skeleton} from '../Skeleton';
7
7
  import {Icon} from '../Icon';
8
8
  import {Styles} from '../Consts';
9
- import {FastImagePropsWithoutStyle} from './types';
10
-
11
- export interface ImageProps extends FastImagePropsWithoutStyle {
12
- style?: StyleProp<ViewStyle>;
13
- loading?: boolean;
14
- accessibilityLabel?: string;
15
- }
9
+ import {ImageProps} from './types';
16
10
 
17
11
  type Status = 'success' | 'loading' | 'error';
18
12
 
19
- const Image: React.FC<ImageProps> = ({
20
- style,
21
- source,
22
- accessibilityLabel,
23
- loading,
24
- ...rest
25
- }) => {
13
+ const Image: React.FC<ImageProps> = ({style, source, loading, ...rest}) => {
26
14
  const {theme} = useContext(ApplicationContext);
27
15
  const error = useRef(false);
28
16
  const [status, setStatus] = useState<Status>('success');
@@ -31,24 +19,15 @@ const Image: React.FC<ImageProps> = ({
31
19
  * render content loading | fail | rendered
32
20
  */
33
21
  const renderContent = () => {
34
- if (status == 'loading' || status == 'error') {
35
- let content = (
36
- <Skeleton style={[StyleSheet.absoluteFill, styles.image]} />
37
- );
38
- if (status == 'error') {
22
+ if (status === 'loading' || status === 'error') {
23
+ let content = <Skeleton />;
24
+ if (status === 'error') {
39
25
  content = (
40
- <View style={Styles.flexCenter}>
41
- <Icon source="media_fail" color={theme.colors.text.disable} />
42
- </View>
26
+ <Icon source="media_fail" color={theme.colors.text.disable} />
43
27
  );
44
28
  }
45
29
  return (
46
- <View
47
- style={[
48
- StyleSheet.absoluteFill,
49
- styles.image,
50
- {backgroundColor: theme.colors.background.disable},
51
- ]}>
30
+ <View style={[StyleSheet.absoluteFill, Styles.flexCenter]}>
52
31
  {content}
53
32
  </View>
54
33
  );
@@ -56,33 +35,32 @@ const Image: React.FC<ImageProps> = ({
56
35
  };
57
36
 
58
37
  return (
59
- <View
38
+ <FastImage
39
+ {...rest}
40
+ source={source}
60
41
  style={[styles.container, style]}
61
- accessibilityLabel={`Image/${
62
- accessibilityLabel ?? (typeof source === 'number' ? source : source.uri)
63
- }`}>
64
- <FastImage
65
- {...rest}
66
- source={source}
67
- fallback={false}
68
- style={styles.image}
69
- onProgress={() => {
70
- if (status != 'loading' && loading) setStatus('loading');
71
- }}
72
- onLoadStart={() => {
73
- error.current = false;
74
- }}
75
- onLoadEnd={() => {
76
- let current: Status = 'success';
77
- if (error.current) current = 'error';
78
- if (status != current) setStatus(current);
79
- }}
80
- onError={() => {
81
- error.current = true;
82
- }}
83
- />
42
+ onProgress={() => {
43
+ if (status !== 'loading' && loading) {
44
+ setStatus('loading');
45
+ }
46
+ }}
47
+ onLoadStart={() => {
48
+ error.current = false;
49
+ }}
50
+ onLoadEnd={() => {
51
+ let current: Status = 'success';
52
+ if (error.current) {
53
+ current = 'error';
54
+ }
55
+ if (status !== current) {
56
+ setStatus(current);
57
+ }
58
+ }}
59
+ onError={() => {
60
+ error.current = true;
61
+ }}>
84
62
  {renderContent()}
85
- </View>
63
+ </FastImage>
86
64
  );
87
65
  };
88
66
 
package/Image/styles.ts CHANGED
@@ -2,11 +2,8 @@ import {StyleSheet} from 'react-native';
2
2
 
3
3
  export default StyleSheet.create({
4
4
  container: {
5
- overflow: 'hidden',
6
5
  alignItems: 'center',
7
6
  justifyContent: 'center',
8
- },
9
- image: {
10
7
  width: '100%',
11
8
  height: '100%',
12
9
  },
package/Image/types.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  import {FastImageProps} from 'react-native-fast-image';
2
2
 
3
- export type FastImagePropsWithoutStyle = Omit<FastImageProps, 'style'>;
3
+ export interface ImageProps extends FastImageProps {
4
+ loading?: boolean;
5
+ }
package/Input/Input.tsx CHANGED
@@ -35,7 +35,7 @@ const Input = forwardRef(
35
35
  loading,
36
36
  leadingIcon,
37
37
  leadingIconColor,
38
- fontWeight = 'normal',
38
+ fontWeight = 'Regular',
39
39
  style,
40
40
  ...props
41
41
  }: InputProps,
@@ -81,7 +81,6 @@ const Input = forwardRef(
81
81
  let textColor = theme.colors.text.default;
82
82
  let placeholderColor = theme.colors.text.hint;
83
83
  let iconTintColor = iconColor;
84
- const inputTextWeight = fontWeight === 'bold' ? 'Bold' : 'Regular';
85
84
 
86
85
  if (disabled) {
87
86
  textColor = disabledColor;
@@ -124,7 +123,7 @@ const Input = forwardRef(
124
123
  styles.input,
125
124
  {
126
125
  color: textColor,
127
- fontFamily: `${theme.font}-${inputTextWeight}`,
126
+ fontFamily: `${theme.font}-${fontWeight}`,
128
127
  },
129
128
  ]}
130
129
  textBreakStrategy="highQuality"
package/Input/index.tsx CHANGED
@@ -77,7 +77,7 @@ export interface InputProps extends TextInputProps {
77
77
  */
78
78
  leadingIconColor?: string;
79
79
 
80
- fontWeight?: 'normal' | 'bold';
80
+ fontWeight?: 'Regular' | 'Bold';
81
81
  }
82
82
 
83
83
  type InputPropsWithoutSizeAndIcon = Omit<
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.81.14",
3
+ "version": "0.81.17",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {
@@ -10,17 +10,17 @@
10
10
  "@momo-kits/foundation"
11
11
  ],
12
12
  "dependencies": {
13
- "@gorhom/bottom-sheet": "git+https://gitlab.com/dung.huynh1/bottom-sheet.git#main",
13
+ "@gorhom/bottom-sheet": "https://gitlab.com/momo-platform/bottom-sheet.git",
14
14
  "react-native-safe-area-context": "3.1.4",
15
15
  "react-native-linear-gradient": "2.8.3",
16
16
  "react-native-gesture-handler": "1.10.3",
17
17
  "react-native-fast-image": "8.1.5",
18
- "@react-navigation/bottom-tabs": "git+https://gitlab.com/dung.huynh1/react-navigation-bottom-tabs.git#main",
18
+ "@react-navigation/bottom-tabs": "https://gitlab.com/momo-platform/react-navigation-bottom-tabs.git#main",
19
19
  "@react-navigation/core": "5.16.1",
20
20
  "@react-navigation/native": "5.9.8",
21
21
  "@react-navigation/routers": "5.7.4",
22
22
  "lottie-react-native": "3.3.2",
23
- "@react-navigation/stack": "git+https://gitlab.com/dung.huynh1/react-navigation-stack.git#main"
23
+ "@react-navigation/stack": "https://gitlab.com/momo-platform/react-navigation-stack.git"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react-native": "*"