@momo-kits/foundation 0.154.1-test.18 → 0.155.1-beta.1
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/BottomSheet.tsx +15 -10
- package/Application/BottomTab/BottomTabBar.tsx +7 -2
- package/Application/BottomTab/CustomBottomTabItem.tsx +8 -1
- package/Application/Components/HeaderAnimated.tsx +2 -12
- package/Application/Components/HeaderBackground.tsx +7 -3
- package/Application/Components/HeaderExtendHeader.tsx +6 -12
- package/Application/Components/HeaderRight.tsx +0 -9
- package/Application/Components/HeaderTitle.tsx +13 -17
- package/Application/Components/NavigationButton.tsx +0 -9
- package/Application/Components/SearchHeader.tsx +9 -4
- package/Application/Localize.ts +2 -2
- package/Badge/Badge.tsx +9 -2
- package/Badge/BadgeDot.tsx +15 -5
- package/Badge/BadgeRibbon.tsx +10 -2
- package/Badge/styles.ts +1 -0
- package/Button/index.tsx +7 -8
- package/Button/styles.ts +2 -0
- package/CheckBox/index.tsx +13 -2
- package/CheckBox/styles.ts +5 -4
- package/Icon/index.tsx +15 -2
- package/IconButton/index.tsx +9 -2
- package/IconButton/styles.ts +3 -2
- package/Image/index.tsx +12 -2
- package/Image/styles.ts +3 -1
- package/Input/Input.tsx +15 -2
- package/Input/InputDropDown.tsx +13 -2
- package/Input/InputMoney.tsx +15 -2
- package/Input/InputOTP.tsx +20 -3
- package/Input/InputPhoneNumber.tsx +15 -2
- package/Input/InputSearch.tsx +15 -2
- package/Input/InputTextArea.tsx +12 -10
- package/Input/styles.ts +1 -0
- package/Layout/Card.tsx +5 -1
- package/Layout/Item.tsx +5 -1
- package/Layout/Section.tsx +5 -1
- package/Layout/styles.ts +3 -2
- package/Pagination/PaginationDot.tsx +8 -2
- package/Pagination/PaginationNumber.tsx +13 -6
- package/Pagination/PaginationScroll.tsx +11 -2
- package/Pagination/PaginationWhiteDot.tsx +14 -7
- package/Pagination/styles.ts +4 -3
- package/Popup/PopupNotify.tsx +4 -1
- package/Popup/PopupPromotion.tsx +8 -2
- package/Radio/index.tsx +9 -1
- package/Radio/styles.ts +5 -4
- package/Switch/index.tsx +6 -2
- package/Switch/styles.ts +3 -1
- package/Tag/index.tsx +28 -16
- package/Title/index.tsx +10 -2
- package/Title/styles.ts +4 -3
- package/package.json +34 -34
- package/Tag/styles.ts +0 -25
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
View,
|
|
13
13
|
} from 'react-native';
|
|
14
14
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
15
|
-
import { ApplicationContext } from '../Context';
|
|
15
|
+
import { ApplicationContext, MiniAppContext } from '../Context';
|
|
16
16
|
import { BottomSheetParams } from './types';
|
|
17
17
|
import { Colors, Radius, Spacing, Styles } from '../Consts';
|
|
18
18
|
import { Text } from '../Text';
|
|
@@ -32,12 +32,15 @@ import layoutStyles from '../Layout/styles';
|
|
|
32
32
|
|
|
33
33
|
const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
34
34
|
const { theme, navigator } = useContext(ApplicationContext);
|
|
35
|
+
const context = useContext<any>(MiniAppContext);
|
|
35
36
|
const heightDevice = Dimensions.get('screen').height;
|
|
36
37
|
const action = useRef<undefined | string>(undefined);
|
|
37
38
|
const insets = useSafeAreaInsets();
|
|
38
39
|
const heightHeader = useHeaderHeight();
|
|
39
40
|
const keyboardOffset = heightHeader - Math.min(insets.bottom, 21);
|
|
40
41
|
|
|
42
|
+
const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
|
|
43
|
+
|
|
41
44
|
const {
|
|
42
45
|
screen: Screen,
|
|
43
46
|
options,
|
|
@@ -152,15 +155,15 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
152
155
|
);
|
|
153
156
|
|
|
154
157
|
useEffect(() => {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
158
|
+
const backHandler = BackHandler.addEventListener(
|
|
159
|
+
'hardwareBackPress',
|
|
160
|
+
() => {
|
|
161
|
+
onDismiss();
|
|
162
|
+
return true;
|
|
163
|
+
},
|
|
164
|
+
);
|
|
165
|
+
return () => backHandler.remove();
|
|
166
|
+
}, [barrierDismissible, onDismiss]);
|
|
164
167
|
|
|
165
168
|
/**
|
|
166
169
|
* render header
|
|
@@ -283,6 +286,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
283
286
|
borderTopRightRadius: Radius.M,
|
|
284
287
|
overflow: 'hidden',
|
|
285
288
|
},
|
|
289
|
+
showBaseLineDebug && styles.debugBaseLine,
|
|
286
290
|
]}
|
|
287
291
|
>
|
|
288
292
|
{renderHeader()}
|
|
@@ -348,6 +352,7 @@ const styles = StyleSheet.create({
|
|
|
348
352
|
justifyContent: 'center',
|
|
349
353
|
marginHorizontal: Spacing.M,
|
|
350
354
|
},
|
|
355
|
+
debugBaseLine: { borderWidth: 1, borderColor: Colors.green_06 },
|
|
351
356
|
});
|
|
352
357
|
|
|
353
358
|
export default BottomSheet;
|
|
@@ -15,7 +15,7 @@ import { Icon } from '../../Icon';
|
|
|
15
15
|
import { Text } from '../../Text';
|
|
16
16
|
import { FloatingButtonProps } from '../types';
|
|
17
17
|
import CustomBottomTabItem from './CustomBottomTabItem';
|
|
18
|
-
import { ApplicationContext } from '../../Context';
|
|
18
|
+
import { ApplicationContext, MiniAppContext } from '../../Context';
|
|
19
19
|
|
|
20
20
|
type Props = BottomTabBarProps & {
|
|
21
21
|
activeTintColor?: string;
|
|
@@ -62,6 +62,9 @@ export default function BottomTabBar({
|
|
|
62
62
|
const paddingBottom = getPaddingBottom(insets);
|
|
63
63
|
const focusedTab = state?.routes[state.index]?.name || routes[0]?.params;
|
|
64
64
|
|
|
65
|
+
const context = useContext<any>(MiniAppContext);
|
|
66
|
+
const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
|
|
67
|
+
|
|
65
68
|
/**
|
|
66
69
|
* render tab item
|
|
67
70
|
*/
|
|
@@ -147,7 +150,7 @@ export default function BottomTabBar({
|
|
|
147
150
|
};
|
|
148
151
|
|
|
149
152
|
return (
|
|
150
|
-
<View style={Styles.flex}>
|
|
153
|
+
<View style={[Styles.flex, showBaseLineDebug && styles.debugBaseLine]}>
|
|
151
154
|
<TouchableOpacity
|
|
152
155
|
onPress={floatingButton?.onPress}
|
|
153
156
|
style={styles.floatingContainer}
|
|
@@ -184,6 +187,7 @@ export default function BottomTabBar({
|
|
|
184
187
|
floatingButton?.icon,
|
|
185
188
|
floatingButton?.label,
|
|
186
189
|
floatingButton?.onPress,
|
|
190
|
+
showBaseLineDebug,
|
|
187
191
|
theme.colors.primary,
|
|
188
192
|
]);
|
|
189
193
|
|
|
@@ -311,4 +315,5 @@ const styles = StyleSheet.create({
|
|
|
311
315
|
borderBottomLeftRadius: 1,
|
|
312
316
|
borderBottomRightRadius: 1,
|
|
313
317
|
},
|
|
318
|
+
debugBaseLine: { borderWidth: 1, borderColor: Colors.green_06 },
|
|
314
319
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
2
|
import { TouchableOpacity, StyleSheet, Platform } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
BottomTabBarButtonProps,
|
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
import { Route } from '@react-navigation/native';
|
|
8
8
|
import { TabBarIcon } from './TabBarIcon';
|
|
9
9
|
import { Text } from '../../Text';
|
|
10
|
+
import { MiniAppContext } from '../../Context';
|
|
11
|
+
import { Colors } from '../../Consts';
|
|
10
12
|
|
|
11
13
|
type LabelType = NonNullable<BottomTabNavigationOptions['tabBarLabel']>;
|
|
12
14
|
|
|
@@ -58,6 +60,9 @@ const CustomBottomTabItem: React.FC<CustomBottomTabItemProps> = ({
|
|
|
58
60
|
badgeStyle,
|
|
59
61
|
allowFontScaling,
|
|
60
62
|
}) => {
|
|
63
|
+
const context = useContext<any>(MiniAppContext);
|
|
64
|
+
const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
|
|
65
|
+
|
|
61
66
|
const renderIcon = () => {
|
|
62
67
|
if (icon === undefined) {
|
|
63
68
|
return null;
|
|
@@ -123,6 +128,7 @@ const CustomBottomTabItem: React.FC<CustomBottomTabItemProps> = ({
|
|
|
123
128
|
: inactiveBackgroundColor,
|
|
124
129
|
},
|
|
125
130
|
style,
|
|
131
|
+
showBaseLineDebug && styles.debugBaseLine,
|
|
126
132
|
]}
|
|
127
133
|
>
|
|
128
134
|
{renderIcon()}
|
|
@@ -143,6 +149,7 @@ const styles = StyleSheet.create({
|
|
|
143
149
|
fontSize: 12,
|
|
144
150
|
fontWeight: '600',
|
|
145
151
|
},
|
|
152
|
+
debugBaseLine: { borderWidth: 1, borderColor: Colors.green_06 },
|
|
146
153
|
});
|
|
147
154
|
|
|
148
155
|
export default CustomBottomTabItem;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Animated, StyleSheet
|
|
1
|
+
import { Animated, StyleSheet } from 'react-native';
|
|
2
2
|
import { type HeaderAnimatedProps } from '../types';
|
|
3
|
-
import React
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import { Image } from '../../Image';
|
|
5
|
-
import { MiniAppContext } from '../../Context';
|
|
6
5
|
import { Colors } from '../../Consts';
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -50,19 +49,10 @@ const HeaderAnimated: React.FC<HeaderAnimatedProps> = ({
|
|
|
50
49
|
style={styles.full}
|
|
51
50
|
/>
|
|
52
51
|
)}
|
|
53
|
-
<Verified />
|
|
54
52
|
</Animated.View>
|
|
55
53
|
);
|
|
56
54
|
};
|
|
57
55
|
|
|
58
|
-
const Verified: React.FC<any> = () => {
|
|
59
|
-
const context = useContext<any>(MiniAppContext);
|
|
60
|
-
if (context.environment === 'uat') {
|
|
61
|
-
return <View style={styles.verifiedDot} />;
|
|
62
|
-
}
|
|
63
|
-
return <View />;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
56
|
const styles = StyleSheet.create({
|
|
67
57
|
container: { width: '100%', aspectRatio: 16 / 9 },
|
|
68
58
|
verifiedDot: {
|
|
@@ -2,8 +2,8 @@ import LinearGradient from 'react-native-linear-gradient';
|
|
|
2
2
|
import { Animated, StyleSheet, View } from 'react-native';
|
|
3
3
|
import React, { useContext } from 'react';
|
|
4
4
|
import { HeaderBackgroundProps } from '../types';
|
|
5
|
-
import { ApplicationContext } from '../../Context';
|
|
6
|
-
import { Styles } from '../../Consts';
|
|
5
|
+
import { ApplicationContext, MiniAppContext } from '../../Context';
|
|
6
|
+
import { Colors, Styles } from '../../Consts';
|
|
7
7
|
import { Image } from '../../Image';
|
|
8
8
|
import BackgroundImageView from './BackgroundImageView';
|
|
9
9
|
|
|
@@ -20,9 +20,12 @@ const HeaderBackground: React.FC<HeaderBackgroundProps> = ({
|
|
|
20
20
|
headerBackground,
|
|
21
21
|
}) => {
|
|
22
22
|
const { theme } = useContext(ApplicationContext);
|
|
23
|
+
const context = useContext<any>(MiniAppContext);
|
|
23
24
|
const gradientColor = customGradientColor ?? theme.colors.gradient;
|
|
24
25
|
const headerImage = headerBackground ?? theme.assets?.headerBackground;
|
|
25
26
|
|
|
27
|
+
const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
|
|
28
|
+
|
|
26
29
|
const opacityBackground = animatedValue?.interpolate({
|
|
27
30
|
inputRange: [0, 52],
|
|
28
31
|
outputRange: [0, 1],
|
|
@@ -30,7 +33,7 @@ const HeaderBackground: React.FC<HeaderBackgroundProps> = ({
|
|
|
30
33
|
});
|
|
31
34
|
|
|
32
35
|
return (
|
|
33
|
-
<View style={Styles.flex}>
|
|
36
|
+
<View style={[Styles.flex, showBaseLineDebug && styles.debugBaseLine]}>
|
|
34
37
|
<BackgroundImageView
|
|
35
38
|
useShadowHeader={useShadowHeader}
|
|
36
39
|
heightHeader={'100%'}
|
|
@@ -74,6 +77,7 @@ const styles = StyleSheet.create({
|
|
|
74
77
|
position: 'absolute',
|
|
75
78
|
aspectRatio: 375 / 154,
|
|
76
79
|
},
|
|
80
|
+
debugBaseLine: { borderWidth: 1, borderColor: Colors.green_06 },
|
|
77
81
|
});
|
|
78
82
|
|
|
79
83
|
export { HeaderBackground };
|
|
@@ -43,11 +43,14 @@ const HeaderExtendHeader: React.FC<{
|
|
|
43
43
|
headerBackground: customBackground,
|
|
44
44
|
}) => {
|
|
45
45
|
const { theme } = useContext(ApplicationContext);
|
|
46
|
+
const context = useContext<any>(MiniAppContext);
|
|
46
47
|
const animated = useRef(new Animated.Value(0));
|
|
47
48
|
const gradientColor = customGradientColor ?? theme.colors.gradient;
|
|
48
49
|
const headerBackground = customBackground ?? theme.assets?.headerBackground;
|
|
49
50
|
const leftPosition = inputSearchProps?.leftPosition || BACK_WIDTH + 20;
|
|
50
51
|
|
|
52
|
+
const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
|
|
53
|
+
|
|
51
54
|
const opacityBackground = animatedValue?.interpolate({
|
|
52
55
|
inputRange: [0, 52],
|
|
53
56
|
outputRange: [0, 1],
|
|
@@ -95,7 +98,7 @@ const HeaderExtendHeader: React.FC<{
|
|
|
95
98
|
|
|
96
99
|
if (inputSearchProps) {
|
|
97
100
|
return (
|
|
98
|
-
<View style={{ zIndex: 0 }}>
|
|
101
|
+
<View style={[{ zIndex: 0 }, showBaseLineDebug && styles.debugBaseLine]}>
|
|
99
102
|
<Animated.View style={{ height: height }} />
|
|
100
103
|
<BackgroundImageView
|
|
101
104
|
useShadowHeader={useShadowHeader}
|
|
@@ -156,14 +159,13 @@ const HeaderExtendHeader: React.FC<{
|
|
|
156
159
|
</Animated.View>
|
|
157
160
|
</Animated.View>
|
|
158
161
|
</Animated.View>
|
|
159
|
-
<Verified />
|
|
160
162
|
</View>
|
|
161
163
|
);
|
|
162
164
|
}
|
|
163
165
|
|
|
164
166
|
if (headerType === 'extended') {
|
|
165
167
|
return (
|
|
166
|
-
<View style={{ zIndex: 0 }}>
|
|
168
|
+
<View style={[{ zIndex: 0 }, showBaseLineDebug && styles.debugBaseLine]}>
|
|
167
169
|
<BackgroundImageView
|
|
168
170
|
useShadowHeader={useShadowHeader}
|
|
169
171
|
heightHeader={heightHeader}
|
|
@@ -185,7 +187,6 @@ const HeaderExtendHeader: React.FC<{
|
|
|
185
187
|
</LinearGradientAnimated>
|
|
186
188
|
)}
|
|
187
189
|
<View style={{ height: heightHeader }} />
|
|
188
|
-
<Verified />
|
|
189
190
|
</View>
|
|
190
191
|
);
|
|
191
192
|
}
|
|
@@ -193,14 +194,6 @@ const HeaderExtendHeader: React.FC<{
|
|
|
193
194
|
return <View />;
|
|
194
195
|
};
|
|
195
196
|
|
|
196
|
-
const Verified: React.FC<any> = () => {
|
|
197
|
-
const context = useContext<any>(MiniAppContext);
|
|
198
|
-
if (context.environment === 'uat') {
|
|
199
|
-
return <View style={styles.verifiedDot} />;
|
|
200
|
-
}
|
|
201
|
-
return <View />;
|
|
202
|
-
};
|
|
203
|
-
|
|
204
197
|
const styles = StyleSheet.create({
|
|
205
198
|
headerBackground: {
|
|
206
199
|
width: '100%',
|
|
@@ -226,6 +219,7 @@ const styles = StyleSheet.create({
|
|
|
226
219
|
position: 'absolute',
|
|
227
220
|
alignSelf: 'center',
|
|
228
221
|
},
|
|
222
|
+
debugBaseLine: { borderWidth: 1, borderColor: Colors.green_06 },
|
|
229
223
|
});
|
|
230
224
|
|
|
231
225
|
export { HeaderExtendHeader };
|
|
@@ -41,7 +41,6 @@ const HeaderRight: React.FC<any> = props => {
|
|
|
41
41
|
return (
|
|
42
42
|
<View style={styles.headerRightButton}>
|
|
43
43
|
<HeaderToolkitAction {...props.headerRight} tintColor={props.tintColor} />
|
|
44
|
-
<Verified />
|
|
45
44
|
</View>
|
|
46
45
|
);
|
|
47
46
|
};
|
|
@@ -313,14 +312,6 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
313
312
|
);
|
|
314
313
|
};
|
|
315
314
|
|
|
316
|
-
const Verified: React.FC<any> = () => {
|
|
317
|
-
const context = useContext<any>(MiniAppContext);
|
|
318
|
-
if (context.environment === 'uat') {
|
|
319
|
-
return <View style={styles.verifiedDot} />;
|
|
320
|
-
}
|
|
321
|
-
return <View />;
|
|
322
|
-
};
|
|
323
|
-
|
|
324
315
|
const styles = StyleSheet.create({
|
|
325
316
|
navigationButton: {
|
|
326
317
|
height: 28,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
View,
|
|
8
8
|
} from 'react-native';
|
|
9
9
|
import { ApplicationContext, MiniAppContext } from '../../Context';
|
|
10
|
-
import { exportFontFamily,
|
|
10
|
+
import { exportFontFamily, Text, useScaleSize } from '../../Text';
|
|
11
11
|
import { Colors, Radius, Spacing, Styles } from '../../Consts';
|
|
12
12
|
import {
|
|
13
13
|
TitleJourneyProps,
|
|
@@ -22,6 +22,10 @@ import { Skeleton } from '../../Skeleton';
|
|
|
22
22
|
* default header title used for nav
|
|
23
23
|
*/
|
|
24
24
|
const HeaderTitle: React.FC<any> = props => {
|
|
25
|
+
const context = useContext<any>(MiniAppContext);
|
|
26
|
+
|
|
27
|
+
const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
|
|
28
|
+
|
|
25
29
|
const opacity = props.animatedValue?.interpolate(
|
|
26
30
|
props.interpolate ?? {
|
|
27
31
|
inputRange: [0, 200],
|
|
@@ -33,10 +37,13 @@ const HeaderTitle: React.FC<any> = props => {
|
|
|
33
37
|
return (
|
|
34
38
|
<View
|
|
35
39
|
pointerEvents={'none'}
|
|
36
|
-
style={
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
style={[
|
|
41
|
+
{
|
|
42
|
+
justifyContent: 'center',
|
|
43
|
+
maxWidth: Dimensions.get('window').width - 172,
|
|
44
|
+
},
|
|
45
|
+
showBaseLineDebug && styles.debugBaseLine,
|
|
46
|
+
]}
|
|
40
47
|
>
|
|
41
48
|
<Animated.Text
|
|
42
49
|
{...props}
|
|
@@ -56,7 +63,6 @@ const HeaderTitle: React.FC<any> = props => {
|
|
|
56
63
|
]}
|
|
57
64
|
numberOfLines={1}
|
|
58
65
|
/>
|
|
59
|
-
<Verified />
|
|
60
66
|
</View>
|
|
61
67
|
);
|
|
62
68
|
};
|
|
@@ -360,7 +366,6 @@ const TitleUser: React.FC<TitleUserProps> = ({
|
|
|
360
366
|
)}
|
|
361
367
|
</View>
|
|
362
368
|
</View>
|
|
363
|
-
<Verified />
|
|
364
369
|
</TouchableOpacity>
|
|
365
370
|
);
|
|
366
371
|
};
|
|
@@ -421,7 +426,6 @@ const TitleLocation: React.FC<TitleLocationProps> = ({
|
|
|
421
426
|
style={{ marginHorizontal: Spacing.XS }}
|
|
422
427
|
/>
|
|
423
428
|
</View>
|
|
424
|
-
<Verified />
|
|
425
429
|
</TouchableOpacity>
|
|
426
430
|
);
|
|
427
431
|
};
|
|
@@ -513,19 +517,10 @@ const TitleJourney: React.FC<TitleJourneyProps> = ({
|
|
|
513
517
|
</Text>
|
|
514
518
|
</View>
|
|
515
519
|
)}
|
|
516
|
-
<Verified />
|
|
517
520
|
</TouchableOpacity>
|
|
518
521
|
);
|
|
519
522
|
};
|
|
520
523
|
|
|
521
|
-
const Verified: React.FC<any> = () => {
|
|
522
|
-
const context = useContext<any>(MiniAppContext);
|
|
523
|
-
if (context.environment === 'uat') {
|
|
524
|
-
return <View style={styles.verifiedDot} />;
|
|
525
|
-
}
|
|
526
|
-
return <View />;
|
|
527
|
-
};
|
|
528
|
-
|
|
529
524
|
const styles = StyleSheet.create({
|
|
530
525
|
rowJourney: { flexDirection: 'row', width: '100%', alignItems: 'flex-start' },
|
|
531
526
|
verifiedDot: {
|
|
@@ -595,6 +590,7 @@ const styles = StyleSheet.create({
|
|
|
595
590
|
borderRadius: Radius.XS,
|
|
596
591
|
overflow: 'hidden',
|
|
597
592
|
},
|
|
593
|
+
debugBaseLine: { borderWidth: 1, borderColor: Colors.green_06 },
|
|
598
594
|
});
|
|
599
595
|
|
|
600
596
|
export { HeaderTitle, TitleCustom };
|
|
@@ -38,19 +38,10 @@ const NavigationButton: React.FC<NavigationButtonProps> = ({
|
|
|
38
38
|
/>
|
|
39
39
|
</TouchableOpacity>
|
|
40
40
|
{showBadge && <BadgeDot size={'small'} style={styles.badgeDot} />}
|
|
41
|
-
<Verified />
|
|
42
41
|
</View>
|
|
43
42
|
);
|
|
44
43
|
};
|
|
45
44
|
|
|
46
|
-
const Verified: React.FC<any> = () => {
|
|
47
|
-
const context = useContext<any>(MiniAppContext);
|
|
48
|
-
if (context.environment === 'uat') {
|
|
49
|
-
return <View style={styles.verifiedDot} />;
|
|
50
|
-
}
|
|
51
|
-
return <View />;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
45
|
const styles = StyleSheet.create({
|
|
55
46
|
navigationButton: {
|
|
56
47
|
height: 28,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Radius, Spacing, Styles } from '../../Consts';
|
|
1
|
+
import { Colors, Radius, Spacing, Styles } from '../../Consts';
|
|
2
2
|
import { InputRef, InputSearch } from '../../Input';
|
|
3
3
|
import {
|
|
4
4
|
Animated,
|
|
@@ -29,8 +29,8 @@ const SearchHeader = React.forwardRef<InputRef, SearchHeaderProps>(
|
|
|
29
29
|
const { width: screenWidth } = Dimensions.get('window');
|
|
30
30
|
|
|
31
31
|
const animated = useRef(new Animated.Value(0));
|
|
32
|
-
const leftPosition = props?.leftPosition
|
|
33
|
-
const headerRightWidth = props?.headerRightWidth
|
|
32
|
+
const leftPosition = props?.leftPosition ?? BACK_WIDTH + 20;
|
|
33
|
+
const headerRightWidth = props?.headerRightWidth ?? 73;
|
|
34
34
|
|
|
35
35
|
useEffect(() => {
|
|
36
36
|
const listener = animatedValue?.addListener(({ value }) => {
|
|
@@ -77,8 +77,12 @@ const SearchHeader = React.forwardRef<InputRef, SearchHeaderProps>(
|
|
|
77
77
|
return true;
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
+
const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
|
|
81
|
+
|
|
80
82
|
return (
|
|
81
|
-
<View
|
|
83
|
+
<View
|
|
84
|
+
style={[styles.container, showBaseLineDebug && styles.debugBaseLine]}
|
|
85
|
+
>
|
|
82
86
|
<View
|
|
83
87
|
style={[
|
|
84
88
|
Styles.flex,
|
|
@@ -117,6 +121,7 @@ const styles = StyleSheet.create({
|
|
|
117
121
|
searchAction: {
|
|
118
122
|
marginLeft: Spacing.M,
|
|
119
123
|
},
|
|
124
|
+
debugBaseLine: { borderWidth: 1, borderColor: Colors.green_06 },
|
|
120
125
|
});
|
|
121
126
|
|
|
122
127
|
export { SearchHeader };
|
package/Application/Localize.ts
CHANGED
|
@@ -8,8 +8,8 @@ class Localize {
|
|
|
8
8
|
|
|
9
9
|
constructor(assets: LocalizationObject) {
|
|
10
10
|
this.assets = {
|
|
11
|
-
vi: { ...
|
|
12
|
-
en: { ...
|
|
11
|
+
vi: { ...defaultLanguage.vi, ...assets?.vi },
|
|
12
|
+
en: { ...defaultLanguage.en, ...assets?.en },
|
|
13
13
|
};
|
|
14
14
|
this.currentLanguage = 'vi';
|
|
15
15
|
if (NativeModules?.RNResource?.getResourceSync('language') === 'en') {
|
package/Badge/Badge.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, { FC, useContext } from 'react';
|
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { useComponentId } from '../Application';
|
|
5
|
-
import { ApplicationContext } from '../Context';
|
|
5
|
+
import { ApplicationContext, MiniAppContext } from '../Context';
|
|
6
6
|
import { BadgeProps } from './types';
|
|
7
7
|
import { Colors, Radius, Spacing } from '../Consts';
|
|
8
8
|
import { Text, useScaleSize } from '../Text';
|
|
@@ -14,8 +14,11 @@ const Badge: FC<BadgeProps> = ({
|
|
|
14
14
|
accessibilityLabel,
|
|
15
15
|
}) => {
|
|
16
16
|
const { theme } = useContext(ApplicationContext);
|
|
17
|
+
const context = useContext<any>(MiniAppContext);
|
|
17
18
|
const { componentId } = useComponentId('Badge', accessibilityLabel);
|
|
18
19
|
const scaledSize = useScaleSize(16);
|
|
20
|
+
|
|
21
|
+
const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
|
|
19
22
|
|
|
20
23
|
const styles = StyleSheet.create({
|
|
21
24
|
badge: {
|
|
@@ -40,6 +43,10 @@ const Badge: FC<BadgeProps> = ({
|
|
|
40
43
|
backgroundColor: 'transparent',
|
|
41
44
|
alignSelf: 'baseline',
|
|
42
45
|
},
|
|
46
|
+
debugBaseLine: {
|
|
47
|
+
borderWidth: 1,
|
|
48
|
+
borderColor: Colors.green_06,
|
|
49
|
+
},
|
|
43
50
|
});
|
|
44
51
|
|
|
45
52
|
const isValidatedColor = () => {
|
|
@@ -77,7 +84,7 @@ const Badge: FC<BadgeProps> = ({
|
|
|
77
84
|
}
|
|
78
85
|
|
|
79
86
|
return (
|
|
80
|
-
<View style={[style, styles.badgeContainer]}>
|
|
87
|
+
<View style={[style, styles.badgeContainer, showBaseLineDebug && styles.debugBaseLine]}>
|
|
81
88
|
<View
|
|
82
89
|
style={[styles.badge, { backgroundColor: badgeColor }]}
|
|
83
90
|
accessibilityLabel={componentId}
|
package/Badge/BadgeDot.tsx
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import React, {FC} from 'react';
|
|
2
|
-
import {View} from 'react-native';
|
|
3
|
-
import {BadgeDotProps} from './types';
|
|
1
|
+
import React, { FC, useContext } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { BadgeDotProps } from './types';
|
|
4
4
|
import styles from './styles';
|
|
5
|
+
import { MiniAppContext } from '../Context';
|
|
5
6
|
|
|
6
|
-
const BadgeDot: FC<BadgeDotProps> = ({size = 'large', style}) => {
|
|
7
|
+
const BadgeDot: FC<BadgeDotProps> = ({ size = 'large', style }) => {
|
|
8
|
+
const context = useContext<any>(MiniAppContext);
|
|
7
9
|
let dotStyle;
|
|
8
10
|
let dotContainerStyle;
|
|
9
11
|
|
|
12
|
+
const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
|
|
13
|
+
|
|
10
14
|
if (size === 'large') {
|
|
11
15
|
dotStyle = styles.dot;
|
|
12
16
|
dotContainerStyle = styles.dotContainer;
|
|
@@ -16,7 +20,13 @@ const BadgeDot: FC<BadgeDotProps> = ({size = 'large', style}) => {
|
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
return (
|
|
19
|
-
<View
|
|
23
|
+
<View
|
|
24
|
+
style={[
|
|
25
|
+
style,
|
|
26
|
+
dotContainerStyle,
|
|
27
|
+
showBaseLineDebug && styles.debugBaseLine,
|
|
28
|
+
]}
|
|
29
|
+
>
|
|
20
30
|
<View style={[dotStyle]} />
|
|
21
31
|
</View>
|
|
22
32
|
);
|
package/Badge/BadgeRibbon.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { View } from 'react-native';
|
|
|
3
3
|
import { DownTail, UpTail } from './Shape';
|
|
4
4
|
import styles from './styles';
|
|
5
5
|
import { BadgeRibbonProps } from './types';
|
|
6
|
-
import { ApplicationContext } from '../Context';
|
|
6
|
+
import { ApplicationContext, MiniAppContext } from '../Context';
|
|
7
7
|
import { Text } from '../Text';
|
|
8
8
|
import { Colors } from '../Consts';
|
|
9
9
|
import { Image } from '../Image';
|
|
@@ -15,9 +15,12 @@ const BadgeRibbon: FC<BadgeRibbonProps> = ({
|
|
|
15
15
|
style = {},
|
|
16
16
|
}) => {
|
|
17
17
|
const { theme } = useContext(ApplicationContext);
|
|
18
|
+
const context = useContext<any>(MiniAppContext);
|
|
18
19
|
const isRight = position === 'top_right' || position === 'bottom_right';
|
|
19
20
|
const isUpTail = position === 'bottom_left' || position === 'top_right';
|
|
20
21
|
|
|
22
|
+
const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
|
|
23
|
+
|
|
21
24
|
const ribbonRotate = useMemo(() => (isRight ? '180deg' : '0deg'), [isRight]);
|
|
22
25
|
const textRotate = ribbonRotate;
|
|
23
26
|
const textMargin = useMemo(() => (isUpTail ? 4 : 0), [isUpTail]);
|
|
@@ -93,7 +96,12 @@ const BadgeRibbon: FC<BadgeRibbonProps> = ({
|
|
|
93
96
|
<View
|
|
94
97
|
collapsable={false}
|
|
95
98
|
key={isRight ? 'right' : 'left'}
|
|
96
|
-
style={[
|
|
99
|
+
style={[
|
|
100
|
+
styles.ribbon,
|
|
101
|
+
style,
|
|
102
|
+
{ transform: ribbonTransform },
|
|
103
|
+
showBaseLineDebug && styles.debugBaseLine,
|
|
104
|
+
]}
|
|
97
105
|
>
|
|
98
106
|
{ribbonTail}
|
|
99
107
|
{content}
|
package/Badge/styles.ts
CHANGED
package/Button/index.tsx
CHANGED
|
@@ -13,6 +13,7 @@ import { useComponentId } from '../Application';
|
|
|
13
13
|
import {
|
|
14
14
|
ApplicationContext,
|
|
15
15
|
ComponentContext,
|
|
16
|
+
MiniAppContext,
|
|
16
17
|
SkeletonContext,
|
|
17
18
|
} from '../Context';
|
|
18
19
|
import { Text } from '../Text';
|
|
@@ -71,10 +72,13 @@ const Button: FC<ButtonProps> = ({
|
|
|
71
72
|
...rest
|
|
72
73
|
}) => {
|
|
73
74
|
const { theme, config } = useContext(ApplicationContext);
|
|
75
|
+
const context = useContext<any>(MiniAppContext);
|
|
74
76
|
const skeleton = useContext(SkeletonContext);
|
|
75
77
|
const animationRef = useRef<LottieView>(null);
|
|
76
78
|
const pressAnim = useSharedValue(0);
|
|
77
79
|
|
|
80
|
+
const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
|
|
81
|
+
|
|
78
82
|
const componentName = 'Button';
|
|
79
83
|
const { componentId } = useComponentId(
|
|
80
84
|
`${componentName}/${title}`,
|
|
@@ -111,9 +115,7 @@ const Button: FC<ButtonProps> = ({
|
|
|
111
115
|
const hasLeft = !!left;
|
|
112
116
|
const hasRight = !!right;
|
|
113
117
|
|
|
114
|
-
const loadingOnLeft =
|
|
115
|
-
(!hasLeft && !hasRight) ||
|
|
116
|
-
(hasLeft && !hasRight);
|
|
118
|
+
const loadingOnLeft = (!hasLeft && !hasRight) || (hasLeft && !hasRight);
|
|
117
119
|
|
|
118
120
|
return isLeft === loadingOnLeft;
|
|
119
121
|
};
|
|
@@ -316,10 +318,7 @@ const Button: FC<ButtonProps> = ({
|
|
|
316
318
|
full && { width: '100%' },
|
|
317
319
|
loading && { opacity: 0.75 },
|
|
318
320
|
]);
|
|
319
|
-
const buttonStyle = StyleSheet.flatten([
|
|
320
|
-
sizeStyle,
|
|
321
|
-
typeStyle,
|
|
322
|
-
]);
|
|
321
|
+
const buttonStyle = StyleSheet.flatten([sizeStyle, typeStyle]);
|
|
323
322
|
|
|
324
323
|
const animatedStyle = useAnimatedStyle(() => {
|
|
325
324
|
return {
|
|
@@ -351,7 +350,7 @@ const Button: FC<ButtonProps> = ({
|
|
|
351
350
|
}}
|
|
352
351
|
disabled={isDisabled}
|
|
353
352
|
activeOpacity={0.75}
|
|
354
|
-
style={containerStyle}
|
|
353
|
+
style={[containerStyle, showBaseLineDebug && styles.debugBaseLine]}
|
|
355
354
|
onPressIn={animateIn}
|
|
356
355
|
onPressOut={animateOut}
|
|
357
356
|
>
|
package/Button/styles.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { Colors } from '../Consts';
|
|
2
3
|
|
|
3
4
|
export default StyleSheet.create({
|
|
4
5
|
large: {
|
|
@@ -60,4 +61,5 @@ export default StyleSheet.create({
|
|
|
60
61
|
skeleton: {
|
|
61
62
|
paddingHorizontal: 0,
|
|
62
63
|
},
|
|
64
|
+
debugBaseLine: { borderWidth: 1, borderColor: Colors.green_06 },
|
|
63
65
|
});
|