@momo-kits/foundation 0.92.3-tracking.9 → 0.92.4-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.
- package/Application/BottomTab/index.tsx +7 -1
- package/Application/StackScreen.tsx +0 -3
- package/Application/types.ts +1 -1
- package/Image/index.tsx +34 -39
- package/Input/InputOTP.tsx +4 -2
- package/Input/styles.ts +2 -2
- package/package.json +4 -4
|
@@ -4,6 +4,7 @@ import {createStackNavigator} from '@react-navigation/stack';
|
|
|
4
4
|
import React, {useContext, useEffect} from 'react';
|
|
5
5
|
import {Platform} from 'react-native';
|
|
6
6
|
import {useSafeAreaInsets} from 'react-native-safe-area-context';
|
|
7
|
+
import {Colors} from '../../Consts';
|
|
7
8
|
import {Icon} from '../../Icon';
|
|
8
9
|
import {Text} from '../../Text';
|
|
9
10
|
import {ApplicationContext} from '../index';
|
|
@@ -97,7 +98,8 @@ const BottomTab: React.FC<BottomTabProps> = ({
|
|
|
97
98
|
typography={
|
|
98
99
|
focused ? 'label_xs_medium' : 'description_xs_regular'
|
|
99
100
|
}
|
|
100
|
-
color={color}
|
|
101
|
+
color={color}
|
|
102
|
+
style={{width: '90%', textAlign: 'center'}}>
|
|
101
103
|
{item.label}
|
|
102
104
|
</Text>
|
|
103
105
|
);
|
|
@@ -113,6 +115,10 @@ const BottomTab: React.FC<BottomTabProps> = ({
|
|
|
113
115
|
fontFamily: `${theme.font}-Bold`,
|
|
114
116
|
left: item?.showDot ? 8 : 4,
|
|
115
117
|
top: item?.showDot ? -2 : -6,
|
|
118
|
+
backgroundColor:
|
|
119
|
+
typeof item?.badgeLabel === 'string'
|
|
120
|
+
? Colors.orange_03
|
|
121
|
+
: Colors.red_03,
|
|
116
122
|
},
|
|
117
123
|
tabBarIcon: ({color}) => (
|
|
118
124
|
<Icon source={item.icon} color={color} size={28} />
|
|
@@ -117,9 +117,6 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
117
117
|
<ScreenContext.Provider
|
|
118
118
|
value={{
|
|
119
119
|
screenName,
|
|
120
|
-
autoTracking: (data: any) => {
|
|
121
|
-
navigator?.maxApi?.dispatchFunction?.('autoTracking', data);
|
|
122
|
-
},
|
|
123
120
|
onElementLoad: () => {
|
|
124
121
|
endTime.current = Date.now();
|
|
125
122
|
interaction.current?.cancel?.();
|
package/Application/types.ts
CHANGED
package/Image/index.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, {useContext, useEffect, useRef, useState} from 'react';
|
|
|
2
2
|
import {StyleSheet, View} from 'react-native';
|
|
3
3
|
import FastImage, {Source} from 'react-native-fast-image';
|
|
4
4
|
import styles from './styles';
|
|
5
|
-
import {ApplicationContext, ComponentContext} from '../Application';
|
|
5
|
+
import {ApplicationContext, ComponentContext, MiniAppContext} from '../Application';
|
|
6
6
|
import {Skeleton} from '../Skeleton';
|
|
7
7
|
import {Icon} from '../Icon';
|
|
8
8
|
import {Styles} from '../Consts';
|
|
@@ -20,6 +20,7 @@ const Image: React.FC<ImageProps> = ({
|
|
|
20
20
|
...rest
|
|
21
21
|
}) => {
|
|
22
22
|
const {theme} = useContext(ApplicationContext);
|
|
23
|
+
const app = useContext<any>(MiniAppContext);
|
|
23
24
|
const component = useContext<any>(ComponentContext);
|
|
24
25
|
const error = useRef(false);
|
|
25
26
|
const [status, setStatus] = useState<Status>('success');
|
|
@@ -29,8 +30,10 @@ const Image: React.FC<ImageProps> = ({
|
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
useEffect(() => {
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
if(app.enableAutoId){
|
|
34
|
+
component?.addChildren?.(test.accessibilityLabel, 'add');
|
|
35
|
+
return () => component?.addChildren(test.accessibilityLabel, 'remove');
|
|
36
|
+
}
|
|
34
37
|
}, []);
|
|
35
38
|
|
|
36
39
|
/**
|
|
@@ -54,45 +57,37 @@ const Image: React.FC<ImageProps> = ({
|
|
|
54
57
|
};
|
|
55
58
|
|
|
56
59
|
return (
|
|
57
|
-
<ComponentContext.Provider
|
|
58
|
-
value={{
|
|
59
|
-
componentName: 'Image',
|
|
60
|
-
params,
|
|
61
|
-
state: loading ? 'loading' : 'loaded',
|
|
62
|
-
componentId: test.accessibilityLabel,
|
|
63
|
-
}}>
|
|
64
60
|
<FastImage
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
61
|
+
{...rest}
|
|
62
|
+
{...test}
|
|
63
|
+
source={source}
|
|
64
|
+
style={[styles.container, style]}
|
|
65
|
+
onProgress={() => {
|
|
66
|
+
error.current = false;
|
|
67
|
+
if (status !== 'loading' && loading) {
|
|
68
|
+
setStatus('loading');
|
|
69
|
+
}
|
|
70
|
+
}}
|
|
71
|
+
onLoadStart={() => {
|
|
72
|
+
error.current = false;
|
|
73
|
+
}}
|
|
74
|
+
onLoad={() => {
|
|
75
|
+
error.current = false;
|
|
76
|
+
}}
|
|
77
|
+
onLoadEnd={() => {
|
|
78
|
+
let current: Status = 'success';
|
|
79
|
+
if (error.current) {
|
|
80
|
+
current = 'error';
|
|
81
|
+
}
|
|
82
|
+
if (status !== current) {
|
|
83
|
+
setStatus(current);
|
|
84
|
+
}
|
|
85
|
+
}}
|
|
86
|
+
onError={() => {
|
|
87
|
+
error.current = true;
|
|
88
|
+
}}>
|
|
93
89
|
{renderContent()}
|
|
94
90
|
</FastImage>
|
|
95
|
-
</ComponentContext.Provider>
|
|
96
91
|
);
|
|
97
92
|
};
|
|
98
93
|
|
package/Input/InputOTP.tsx
CHANGED
|
@@ -70,7 +70,7 @@ const InputOTP = forwardRef(
|
|
|
70
70
|
length,
|
|
71
71
|
errorMessage,
|
|
72
72
|
errorSpacing,
|
|
73
|
-
floatingValue,
|
|
73
|
+
floatingValue = 'Label',
|
|
74
74
|
floatingIconColor,
|
|
75
75
|
floatingIcon,
|
|
76
76
|
placeholder,
|
|
@@ -196,7 +196,9 @@ const InputOTP = forwardRef(
|
|
|
196
196
|
styles.otpFloatingView,
|
|
197
197
|
{backgroundColor: theme.colors.background.surface},
|
|
198
198
|
]}>
|
|
199
|
-
<Text
|
|
199
|
+
<Text
|
|
200
|
+
typography={'description_default_regular'}
|
|
201
|
+
color={theme.colors.text.hint}>
|
|
200
202
|
{floatingValue}
|
|
201
203
|
</Text>
|
|
202
204
|
</View>
|
package/Input/styles.ts
CHANGED
|
@@ -53,7 +53,7 @@ export default StyleSheet.create({
|
|
|
53
53
|
marginRight: Spacing.M,
|
|
54
54
|
},
|
|
55
55
|
icon: {
|
|
56
|
-
marginLeft: Spacing.S
|
|
56
|
+
marginLeft: Spacing.S,
|
|
57
57
|
},
|
|
58
58
|
iconWrapper: {
|
|
59
59
|
width: 24,
|
|
@@ -145,7 +145,7 @@ export default StyleSheet.create({
|
|
|
145
145
|
},
|
|
146
146
|
otpFloatingView: {
|
|
147
147
|
position: 'absolute',
|
|
148
|
-
top: -Spacing.
|
|
148
|
+
top: scaleSize(-Spacing.M + 2),
|
|
149
149
|
alignSelf: 'center',
|
|
150
150
|
paddingHorizontal: Spacing.S,
|
|
151
151
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/foundation",
|
|
3
|
-
"version": "0.92.
|
|
3
|
+
"version": "0.92.4-beta.2",
|
|
4
4
|
"description": "React Native Component Kits",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
"@momo-kits/foundation"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@gorhom/bottom-sheet": "
|
|
13
|
+
"@gorhom/bottom-sheet": "2.4.1",
|
|
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-modalize": "2.1.1",
|
|
18
18
|
"react-native-fast-image": "8.1.5",
|
|
19
|
-
"@react-navigation/bottom-tabs": "git+https://gitlab.com/momo-platform/react-navigation-bottom-tabs.git
|
|
19
|
+
"@react-navigation/bottom-tabs": "git+https://gitlab.mservice.com.vn/momo-platform/react-navigation-bottom-tabs.git",
|
|
20
20
|
"@react-navigation/core": "5.16.1",
|
|
21
21
|
"@react-navigation/native": "5.9.8",
|
|
22
22
|
"@react-navigation/routers": "5.7.4",
|
|
23
23
|
"lottie-react-native": "3.3.2",
|
|
24
|
-
"@react-navigation/stack": "git+https://gitlab.com/momo-platform/react-navigation-stack.git
|
|
24
|
+
"@react-navigation/stack": "git+https://gitlab.mservice.com.vn/momo-platform/react-navigation-stack.git"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react-native": "*"
|