@momo-kits/foundation 0.81.14 → 0.81.16
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.
- package/Application/Components.tsx +1 -0
- package/Application/ModalScreen.tsx +1 -0
- package/Application/StackScreen.tsx +1 -0
- package/Application/types.ts +1 -0
- package/Image/index.tsx +32 -54
- package/Image/styles.ts +0 -3
- package/Image/types.ts +3 -1
- package/Input/Input.tsx +2 -3
- package/Input/index.tsx +1 -1
- package/package.json +4 -4
|
@@ -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',
|
package/Application/types.ts
CHANGED
package/Image/index.tsx
CHANGED
|
@@ -1,28 +1,16 @@
|
|
|
1
1
|
import React, {useContext, useRef, useState} from 'react';
|
|
2
|
-
import {
|
|
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 {
|
|
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
|
|
35
|
-
let content =
|
|
36
|
-
|
|
37
|
-
);
|
|
38
|
-
if (status == 'error') {
|
|
22
|
+
if (status === 'loading' || status === 'error') {
|
|
23
|
+
let content = <Skeleton />;
|
|
24
|
+
if (status === 'error') {
|
|
39
25
|
content = (
|
|
40
|
-
<
|
|
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
|
-
<
|
|
38
|
+
<FastImage
|
|
39
|
+
{...rest}
|
|
40
|
+
source={source}
|
|
60
41
|
style={[styles.container, style]}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
</
|
|
63
|
+
</FastImage>
|
|
86
64
|
);
|
|
87
65
|
};
|
|
88
66
|
|
package/Image/styles.ts
CHANGED
package/Image/types.ts
CHANGED
package/Input/Input.tsx
CHANGED
|
@@ -35,7 +35,7 @@ const Input = forwardRef(
|
|
|
35
35
|
loading,
|
|
36
36
|
leadingIcon,
|
|
37
37
|
leadingIconColor,
|
|
38
|
-
fontWeight = '
|
|
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}-${
|
|
126
|
+
fontFamily: `${theme.font}-${fontWeight}`,
|
|
128
127
|
},
|
|
129
128
|
]}
|
|
130
129
|
textBreakStrategy="highQuality"
|
package/Input/index.tsx
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/foundation",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.16",
|
|
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": "
|
|
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": "
|
|
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": "
|
|
23
|
+
"@react-navigation/stack": "https://gitlab.com/momo-platform/react-navigation-stack.git"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react-native": "*"
|