@momo-kits/foundation 0.81.43 → 0.81.48
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.tsx +29 -12
- package/Application/Components.tsx +178 -174
- package/Application/ModalScreen.tsx +4 -17
- package/Application/NavigationContainer.tsx +9 -30
- package/Application/Navigator.ts +14 -9
- package/Application/StackScreen.tsx +25 -28
- package/Application/index.ts +10 -1
- package/Application/types.ts +30 -17
- package/Application/utils.tsx +14 -0
- package/Assets/icon.json +83 -5
- package/Assets/icon_bank.json +506 -0
- package/Badge/Badge.tsx +1 -1
- package/Badge/BadgeRibbon.tsx +2 -2
- package/Badge/styles.ts +5 -2
- package/Button/index.tsx +4 -5
- package/CheckBox/index.tsx +1 -2
- package/Icon/index.tsx +7 -2
- package/Icon/types.ts +1 -1
- package/IconButton/index.tsx +0 -1
- package/Input/Input.tsx +26 -7
- package/Input/InputDropDown.tsx +1 -6
- package/Input/InputMoney.tsx +14 -6
- package/Input/InputOTP.tsx +12 -9
- package/Input/InputSearch.tsx +8 -12
- package/Input/InputTextArea.tsx +4 -6
- package/Input/common.tsx +5 -3
- package/Input/index.tsx +2 -6
- package/Input/styles.ts +1 -3
- package/Layout/Card.tsx +8 -9
- package/Layout/Item.tsx +0 -1
- package/Layout/ItemList.tsx +39 -33
- package/Layout/Screen.tsx +1 -3
- package/Layout/Section.tsx +4 -4
- package/Pagination/PaginationNumber.tsx +1 -1
- package/Pagination/PaginationScroll.tsx +0 -1
- package/Popup/PopupNotify.tsx +28 -32
- package/Popup/PopupPromotion.tsx +24 -28
- package/Radio/index.tsx +1 -2
- package/Skeleton/index.tsx +1 -1
- package/Switch/index.tsx +0 -1
- package/Tag/index.tsx +2 -4
- package/Text/index.tsx +2 -2
- package/Text/styles.ts +38 -0
- package/Text/types.ts +18 -24
- package/Title/index.tsx +2 -2
- package/package.json +2 -2
- package/publish.sh +1 -1
- package/verify.js +0 -35
|
@@ -3,29 +3,45 @@ import {Platform} from 'react-native';
|
|
|
3
3
|
import {BottomTabProps, NavigationScreenProps} from './types';
|
|
4
4
|
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
|
|
5
5
|
import {createStackNavigator} from '@react-navigation/stack';
|
|
6
|
+
import {useSafeAreaInsets} from 'react-native-safe-area-context';
|
|
7
|
+
import {NavigationContainer} from '@react-navigation/native';
|
|
6
8
|
import {Icon} from '../Icon';
|
|
7
9
|
import {Text} from '../Text';
|
|
8
10
|
import {ApplicationContext} from './index';
|
|
9
11
|
import {getStackOptions} from './utils';
|
|
10
12
|
import StackScreen from './StackScreen';
|
|
11
|
-
import {useSafeAreaInsets} from 'react-native-safe-area-context';
|
|
12
13
|
|
|
13
14
|
const Tab = createBottomTabNavigator();
|
|
14
15
|
const Stack = createStackNavigator();
|
|
15
16
|
|
|
16
17
|
const TabScreen: React.FC<NavigationScreenProps> = ({route}) => {
|
|
18
|
+
if (route.params?.nested) {
|
|
19
|
+
return (
|
|
20
|
+
<Stack.Navigator>
|
|
21
|
+
<Stack.Screen
|
|
22
|
+
name="Stack"
|
|
23
|
+
component={StackScreen}
|
|
24
|
+
initialParams={{screen: route.params?.screen}}
|
|
25
|
+
options={{...getStackOptions(), ...route.params?.options}}
|
|
26
|
+
/>
|
|
27
|
+
</Stack.Navigator>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
17
30
|
return (
|
|
18
|
-
<
|
|
19
|
-
<Stack.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
<NavigationContainer independent={true}>
|
|
32
|
+
<Stack.Navigator>
|
|
33
|
+
<Stack.Screen
|
|
34
|
+
name="Stack"
|
|
35
|
+
component={StackScreen}
|
|
36
|
+
initialParams={{screen: route.params?.screen}}
|
|
37
|
+
options={{...getStackOptions(), ...route.params?.options}}
|
|
38
|
+
/>
|
|
39
|
+
</Stack.Navigator>
|
|
40
|
+
</NavigationContainer>
|
|
26
41
|
);
|
|
27
42
|
};
|
|
28
43
|
const BottomTab: React.FC<BottomTabProps> = ({
|
|
44
|
+
nested,
|
|
29
45
|
tabs,
|
|
30
46
|
listeners,
|
|
31
47
|
navigation,
|
|
@@ -61,14 +77,16 @@ const BottomTab: React.FC<BottomTabProps> = ({
|
|
|
61
77
|
key={item.name}
|
|
62
78
|
name={item.name}
|
|
63
79
|
component={TabScreen}
|
|
64
|
-
initialParams={item}
|
|
80
|
+
initialParams={{...item, nested}}
|
|
65
81
|
listeners={listeners}
|
|
66
82
|
options={{
|
|
67
83
|
tabBarLabel: ({color, focused}) => {
|
|
68
84
|
return (
|
|
69
85
|
<Text
|
|
70
86
|
numberOfLines={1}
|
|
71
|
-
typography={
|
|
87
|
+
typography={
|
|
88
|
+
focused ? 'label_xs_medium' : 'description_xs_regular'
|
|
89
|
+
}
|
|
72
90
|
color={color}>
|
|
73
91
|
{item.label}
|
|
74
92
|
</Text>
|
|
@@ -86,7 +104,6 @@ const BottomTab: React.FC<BottomTabProps> = ({
|
|
|
86
104
|
left: item?.showDot ? 8 : 4,
|
|
87
105
|
top: item?.showDot ? -2 : -6,
|
|
88
106
|
},
|
|
89
|
-
|
|
90
107
|
tabBarIcon: ({color}) => (
|
|
91
108
|
<Icon source={item.icon} color={color} size={28} />
|
|
92
109
|
),
|
|
@@ -15,14 +15,13 @@ import {
|
|
|
15
15
|
View,
|
|
16
16
|
ViewStyle,
|
|
17
17
|
} from 'react-native';
|
|
18
|
-
import {ApplicationContext} from './index';
|
|
18
|
+
import {ApplicationContext, MiniAppContext} from './index';
|
|
19
19
|
import {Colors, Radius, Spacing, Styles} from '../Consts';
|
|
20
20
|
import {Image} from '../Image';
|
|
21
21
|
import {
|
|
22
22
|
HeaderAnimatedProps,
|
|
23
23
|
HeaderBackgroundProps,
|
|
24
24
|
HeaderBackProps,
|
|
25
|
-
HeaderToolkitProps,
|
|
26
25
|
NavigationButtonProps,
|
|
27
26
|
TitleCustomProps,
|
|
28
27
|
} from './types';
|
|
@@ -31,80 +30,11 @@ import {Icon} from '../Icon';
|
|
|
31
30
|
import {PopupNotify} from '../Popup';
|
|
32
31
|
import {Badge, BadgeDot} from '../Badge';
|
|
33
32
|
|
|
34
|
-
const styles = StyleSheet.create({
|
|
35
|
-
navigationButton: {
|
|
36
|
-
height: 28,
|
|
37
|
-
width: 28,
|
|
38
|
-
borderRadius: 14,
|
|
39
|
-
justifyContent: 'center',
|
|
40
|
-
alignItems: 'center',
|
|
41
|
-
},
|
|
42
|
-
headerBackground: {
|
|
43
|
-
width: '100%',
|
|
44
|
-
height: undefined,
|
|
45
|
-
position: 'absolute',
|
|
46
|
-
aspectRatio: 375 / 154,
|
|
47
|
-
},
|
|
48
|
-
headerTitleContainer: {
|
|
49
|
-
alignItems: 'center',
|
|
50
|
-
justifyContent: 'center',
|
|
51
|
-
width: '100%',
|
|
52
|
-
},
|
|
53
|
-
circle: {width: 36, height: 36, borderRadius: 18},
|
|
54
|
-
square: {width: 36, height: 36, borderRadius: Radius.XS},
|
|
55
|
-
dotAvatar: {
|
|
56
|
-
position: 'absolute',
|
|
57
|
-
width: 12,
|
|
58
|
-
height: 12,
|
|
59
|
-
borderRadius: 6,
|
|
60
|
-
bottom: 0,
|
|
61
|
-
right: 0,
|
|
62
|
-
borderWidth: 1,
|
|
63
|
-
borderColor: Colors.black_01,
|
|
64
|
-
},
|
|
65
|
-
headerButton: {paddingHorizontal: 4},
|
|
66
|
-
headerRightButton: {
|
|
67
|
-
flexDirection: 'row',
|
|
68
|
-
justifyContent: 'center',
|
|
69
|
-
alignItems: 'center',
|
|
70
|
-
paddingRight: Spacing.S,
|
|
71
|
-
},
|
|
72
|
-
toolkitContainer: {
|
|
73
|
-
marginLeft: Spacing.S,
|
|
74
|
-
padding: Spacing.XS,
|
|
75
|
-
height: 28,
|
|
76
|
-
borderRadius: 14,
|
|
77
|
-
borderColor: '#00000066',
|
|
78
|
-
justifyContent: 'center',
|
|
79
|
-
alignItems: 'center',
|
|
80
|
-
flexDirection: 'row',
|
|
81
|
-
},
|
|
82
|
-
divider: {
|
|
83
|
-
width: 1,
|
|
84
|
-
height: 12,
|
|
85
|
-
marginHorizontal: 4,
|
|
86
|
-
},
|
|
87
|
-
headerLeft: {
|
|
88
|
-
marginLeft: 12,
|
|
89
|
-
},
|
|
90
|
-
title: {
|
|
91
|
-
fontSize: scaleSize(15),
|
|
92
|
-
lineHeight: scaleSize(22),
|
|
93
|
-
fontWeight: 'bold',
|
|
94
|
-
},
|
|
95
|
-
badge: {
|
|
96
|
-
position: 'absolute',
|
|
97
|
-
top: -8,
|
|
98
|
-
right: -8,
|
|
99
|
-
},
|
|
100
|
-
});
|
|
101
|
-
|
|
102
33
|
const NavigationButton: React.FC<NavigationButtonProps> = ({
|
|
103
34
|
icon,
|
|
104
35
|
tintColor,
|
|
105
36
|
onPress,
|
|
106
37
|
useBorder = true,
|
|
107
|
-
accessibilityLabel,
|
|
108
38
|
badgeType,
|
|
109
39
|
badgeValue,
|
|
110
40
|
}) => {
|
|
@@ -118,30 +48,38 @@ const NavigationButton: React.FC<NavigationButtonProps> = ({
|
|
|
118
48
|
};
|
|
119
49
|
}
|
|
120
50
|
|
|
51
|
+
const isNumber = (label: any) => {
|
|
52
|
+
const numberRegex = /^\d+$/;
|
|
53
|
+
return numberRegex.test(String(label));
|
|
54
|
+
};
|
|
55
|
+
|
|
121
56
|
const renderBadge = useCallback(() => {
|
|
122
|
-
if (!badgeValue && !badgeType) return null;
|
|
123
57
|
if (badgeType === 'dot') {
|
|
124
|
-
return <BadgeDot size="small" style={styles.
|
|
58
|
+
return <BadgeDot size="small" style={styles.badgeDot} />;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (isNumber(badgeValue)) {
|
|
62
|
+
return <Badge label={badgeValue} style={styles.badge} />;
|
|
125
63
|
}
|
|
126
|
-
return <Badge label={badgeValue} style={styles.badge} />;
|
|
127
64
|
}, [badgeType, badgeValue]);
|
|
128
65
|
|
|
129
66
|
return (
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
67
|
+
<View style={{width: scaleSize(28)}}>
|
|
68
|
+
<TouchableOpacity
|
|
69
|
+
style={[styles.navigationButton, buttonStyle]}
|
|
70
|
+
onPress={onPress}>
|
|
71
|
+
<Icon
|
|
72
|
+
source={icon}
|
|
73
|
+
color={tintColor ?? theme.colors.text.default}
|
|
74
|
+
size={20}
|
|
75
|
+
/>
|
|
76
|
+
</TouchableOpacity>
|
|
139
77
|
{renderBadge()}
|
|
140
|
-
</
|
|
78
|
+
</View>
|
|
141
79
|
);
|
|
142
80
|
};
|
|
143
81
|
|
|
144
|
-
const HeaderTitle: React.FC<any> =
|
|
82
|
+
const HeaderTitle: React.FC<any> = props => {
|
|
145
83
|
const {theme} = useContext(ApplicationContext);
|
|
146
84
|
const opacity = props.animatedValue?.interpolate({
|
|
147
85
|
inputRange: [0, 200],
|
|
@@ -152,7 +90,6 @@ const HeaderTitle: React.FC<any> = ({accessibilityLabel = '', ...props}) => {
|
|
|
152
90
|
return (
|
|
153
91
|
<Animated.Text
|
|
154
92
|
{...props}
|
|
155
|
-
accessibilityLabel={`HeaderTitle/${accessibilityLabel}${props.children}`}
|
|
156
93
|
style={[
|
|
157
94
|
styles.title,
|
|
158
95
|
{fontFamily: `${theme.font}-Bold`, opacity, color: props.tintColor},
|
|
@@ -166,8 +103,8 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
|
|
|
166
103
|
preventBack,
|
|
167
104
|
onPressLeftHeader,
|
|
168
105
|
useBorder,
|
|
169
|
-
accessibilityLabel = '',
|
|
170
106
|
}) => {
|
|
107
|
+
const context = useContext(MiniAppContext);
|
|
171
108
|
const {navigator} = useContext(ApplicationContext);
|
|
172
109
|
|
|
173
110
|
useEffect(() => {
|
|
@@ -182,13 +119,10 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
|
|
|
182
119
|
const goBackSafe = () => {
|
|
183
120
|
const goBack = () => {
|
|
184
121
|
const canGoBack = navigator?.ref.current?.canGoBack();
|
|
185
|
-
if (!canGoBack
|
|
122
|
+
if (!canGoBack) {
|
|
186
123
|
const currentRoute = navigator?.ref?.current.getCurrentRoute();
|
|
187
124
|
navigator?.maxApi?.trackEvent?.('service_icon_clicked', {
|
|
188
|
-
|
|
189
|
-
app_id: navigator.trackingInfo.appId,
|
|
190
|
-
miniapp_version: navigator.trackingInfo.buildNumber,
|
|
191
|
-
flow_partner_id: navigator.trackingInfo.flowPartnerId,
|
|
125
|
+
...context,
|
|
192
126
|
screen_name: currentRoute?.params?.screen?.name ?? currentRoute?.name,
|
|
193
127
|
trigger_id: '111154000000000000',
|
|
194
128
|
icon_name: 'back',
|
|
@@ -233,7 +167,6 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
|
|
|
233
167
|
icon="ic_back"
|
|
234
168
|
tintColor={tintColor}
|
|
235
169
|
onPress={goBackSafe}
|
|
236
|
-
accessibilityLabel={`${accessibilityLabel}Back`}
|
|
237
170
|
useBorder={useBorder}
|
|
238
171
|
/>
|
|
239
172
|
</View>
|
|
@@ -304,10 +237,10 @@ const HeaderCustom: React.FC<TitleCustomProps> = ({
|
|
|
304
237
|
)}
|
|
305
238
|
</View>
|
|
306
239
|
<View style={[Styles.flex, {paddingHorizontal: 8}]}>
|
|
307
|
-
<Text typography="
|
|
240
|
+
<Text typography="header_default_bold" color={tintColor}>
|
|
308
241
|
{title}
|
|
309
242
|
</Text>
|
|
310
|
-
<Text typography="
|
|
243
|
+
<Text typography="description_default_regular" color={tintColor}>
|
|
311
244
|
{subTitle}
|
|
312
245
|
</Text>
|
|
313
246
|
</View>
|
|
@@ -347,10 +280,16 @@ const HeaderRightAction: React.FC<any> = ({children, ...restProps}) => {
|
|
|
347
280
|
return <View style={styles.headerRightButton}>{renderAction()}</View>;
|
|
348
281
|
};
|
|
349
282
|
|
|
350
|
-
const HeaderToolkitAction: React.FC<any> = ({
|
|
283
|
+
const HeaderToolkitAction: React.FC<any> = ({
|
|
284
|
+
tintColor,
|
|
285
|
+
pinnedTool,
|
|
286
|
+
runtimeTools = [],
|
|
287
|
+
preventBack,
|
|
288
|
+
}) => {
|
|
351
289
|
const {theme, navigator} = useContext(ApplicationContext);
|
|
352
|
-
const
|
|
353
|
-
const
|
|
290
|
+
const miniContext = useContext(MiniAppContext);
|
|
291
|
+
const [toolConfig, setToolConfig] = useState<any>();
|
|
292
|
+
const {onAction} = toolConfig ?? {};
|
|
354
293
|
|
|
355
294
|
let backgroundColor;
|
|
356
295
|
if (tintColor != Colors.black_01) {
|
|
@@ -358,98 +297,94 @@ const HeaderToolkitAction: React.FC<any> = ({tintColor}) => {
|
|
|
358
297
|
}
|
|
359
298
|
|
|
360
299
|
useEffect(() => {
|
|
361
|
-
if (
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
'getToolkitConfig',
|
|
368
|
-
[undefined],
|
|
369
|
-
(config: any) => {
|
|
370
|
-
navigator.toolkitConfig = {
|
|
371
|
-
...config?.utilityToolConfig,
|
|
372
|
-
appCode: config?.appCode,
|
|
373
|
-
};
|
|
374
|
-
setToolConfig(navigator?.toolkitConfig);
|
|
375
|
-
},
|
|
376
|
-
);
|
|
377
|
-
}
|
|
378
|
-
});
|
|
300
|
+
if (miniContext?.toolkitConfig?.hidden === false) {
|
|
301
|
+
if (navigator?.toolkitConfig) {
|
|
302
|
+
setToolConfig(navigator?.toolkitConfig);
|
|
303
|
+
} else {
|
|
304
|
+
getToolkitConfig();
|
|
305
|
+
}
|
|
379
306
|
}
|
|
380
307
|
}, []);
|
|
381
308
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
(data: any) => {
|
|
392
|
-
if (data?.status) {
|
|
393
|
-
setToolConfig({
|
|
394
|
-
...(toolConfig as HeaderToolkitProps),
|
|
395
|
-
hidden: true,
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
);
|
|
400
|
-
addFavorite = navigator?.requestApi(
|
|
401
|
-
'observer',
|
|
402
|
-
[removeSchema],
|
|
403
|
-
(data: any) => {
|
|
404
|
-
if (data?.status) {
|
|
405
|
-
setToolConfig({
|
|
406
|
-
...(toolConfig as HeaderToolkitProps),
|
|
407
|
-
hidden: false,
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
},
|
|
411
|
-
);
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
return () => {
|
|
415
|
-
addFavorite?.();
|
|
416
|
-
removeFavorite?.();
|
|
417
|
-
};
|
|
418
|
-
}, [appCode]);
|
|
419
|
-
|
|
420
|
-
const onUtilityTool = () => {
|
|
421
|
-
onAction?.('onUtilityTool');
|
|
422
|
-
navigator?.requestApi(type, undefined, undefined);
|
|
309
|
+
const getToolkitConfig = () => {
|
|
310
|
+
navigator?.maxApi?.dispatchFunction?.(
|
|
311
|
+
'getToolsConfig',
|
|
312
|
+
[undefined],
|
|
313
|
+
(config: any) => {
|
|
314
|
+
navigator.toolkitConfig = config;
|
|
315
|
+
setToolConfig(navigator?.toolkitConfig);
|
|
316
|
+
},
|
|
317
|
+
);
|
|
423
318
|
};
|
|
424
319
|
|
|
425
320
|
const onMore = () => {
|
|
426
321
|
onAction?.('onMore');
|
|
427
|
-
navigator?.
|
|
322
|
+
navigator?.maxApi?.dispatchFunction?.(
|
|
323
|
+
'showTools',
|
|
324
|
+
{runtimeTools},
|
|
325
|
+
(res: {item: {action?: string; key: string}}) => {
|
|
326
|
+
const {item} = res;
|
|
327
|
+
navigator?.toolkitCallback?.(item);
|
|
328
|
+
getToolkitConfig();
|
|
329
|
+
},
|
|
330
|
+
);
|
|
428
331
|
};
|
|
429
332
|
|
|
430
333
|
const onClose = () => {
|
|
431
|
-
|
|
432
|
-
|
|
334
|
+
if (preventBack) {
|
|
335
|
+
navigator?.showModal({
|
|
336
|
+
screen: () => (
|
|
337
|
+
<PopupNotify
|
|
338
|
+
{...preventBack}
|
|
339
|
+
primary={{
|
|
340
|
+
title: preventBack.primary.title,
|
|
341
|
+
onPress: () => {
|
|
342
|
+
preventBack?.primary.onPress();
|
|
343
|
+
navigator?.maxApi?.dispatchFunction?.(
|
|
344
|
+
'dismiss',
|
|
345
|
+
undefined,
|
|
346
|
+
undefined,
|
|
347
|
+
);
|
|
348
|
+
},
|
|
349
|
+
}}
|
|
350
|
+
/>
|
|
351
|
+
),
|
|
352
|
+
});
|
|
353
|
+
} else {
|
|
354
|
+
navigator?.maxApi?.dispatchFunction?.('dismiss', undefined, undefined);
|
|
355
|
+
}
|
|
433
356
|
};
|
|
434
357
|
|
|
435
|
-
const
|
|
436
|
-
|
|
358
|
+
const renderPinnedTool = () => {
|
|
359
|
+
const pinKey = pinnedTool?.key || toolConfig?.pinnedTool?.key;
|
|
360
|
+
const pinTool = toolConfig?.tools?.find((i: any) => i.key === pinKey);
|
|
361
|
+
const {badgeValue, badgeType} = pinnedTool ?? {};
|
|
362
|
+
|
|
363
|
+
if (pinTool)
|
|
437
364
|
return (
|
|
438
365
|
<NavigationButton
|
|
439
|
-
|
|
440
|
-
icon={type as string}
|
|
366
|
+
icon={pinTool.icon as string}
|
|
441
367
|
tintColor={tintColor}
|
|
442
|
-
|
|
368
|
+
badgeValue={badgeValue}
|
|
369
|
+
badgeType={badgeType}
|
|
370
|
+
onPress={() => {
|
|
371
|
+
navigator?.maxApi?.dispatchFunction?.(
|
|
372
|
+
'onToolAction',
|
|
373
|
+
[pinTool?.key],
|
|
374
|
+
() => {
|
|
375
|
+
getToolkitConfig();
|
|
376
|
+
},
|
|
377
|
+
);
|
|
378
|
+
navigator?.toolkitCallback?.(pinTool.key);
|
|
379
|
+
}}
|
|
443
380
|
/>
|
|
444
381
|
);
|
|
445
|
-
}
|
|
446
|
-
return null;
|
|
447
382
|
};
|
|
448
383
|
|
|
449
384
|
if (toolConfig) {
|
|
450
385
|
return (
|
|
451
386
|
<View style={styles.headerRightButton}>
|
|
452
|
-
{
|
|
387
|
+
{renderPinnedTool()}
|
|
453
388
|
<View
|
|
454
389
|
style={[
|
|
455
390
|
styles.toolkitContainer,
|
|
@@ -458,15 +393,11 @@ const HeaderToolkitAction: React.FC<any> = ({tintColor}) => {
|
|
|
458
393
|
borderWidth: backgroundColor ? 0.5 : 0,
|
|
459
394
|
},
|
|
460
395
|
]}>
|
|
461
|
-
<TouchableOpacity
|
|
462
|
-
accessibilityLabel={'Toolkit/More'}
|
|
463
|
-
onPress={onMore}>
|
|
396
|
+
<TouchableOpacity onPress={onMore}>
|
|
464
397
|
<Icon color={tintColor} source="navigation_more_horiz" size={20} />
|
|
465
398
|
</TouchableOpacity>
|
|
466
399
|
<View style={[styles.divider, {backgroundColor: tintColor}]} />
|
|
467
|
-
<TouchableOpacity
|
|
468
|
-
accessibilityLabel={`Toolkit/Close`}
|
|
469
|
-
onPress={onClose}>
|
|
400
|
+
<TouchableOpacity onPress={onClose}>
|
|
470
401
|
<Icon
|
|
471
402
|
color={tintColor}
|
|
472
403
|
source="16_navigation_close_circle"
|
|
@@ -521,6 +452,79 @@ const HeaderAnimated: React.FC<HeaderAnimatedProps> = ({
|
|
|
521
452
|
);
|
|
522
453
|
};
|
|
523
454
|
|
|
455
|
+
const styles = StyleSheet.create({
|
|
456
|
+
navigationButton: {
|
|
457
|
+
height: 28,
|
|
458
|
+
width: 28,
|
|
459
|
+
borderRadius: 14,
|
|
460
|
+
justifyContent: 'center',
|
|
461
|
+
alignItems: 'center',
|
|
462
|
+
},
|
|
463
|
+
headerBackground: {
|
|
464
|
+
width: '100%',
|
|
465
|
+
height: undefined,
|
|
466
|
+
position: 'absolute',
|
|
467
|
+
aspectRatio: 375 / 154,
|
|
468
|
+
},
|
|
469
|
+
headerTitleContainer: {
|
|
470
|
+
alignItems: 'center',
|
|
471
|
+
justifyContent: 'center',
|
|
472
|
+
width: '100%',
|
|
473
|
+
},
|
|
474
|
+
circle: {width: 36, height: 36, borderRadius: 18},
|
|
475
|
+
square: {width: 36, height: 36, borderRadius: Radius.XS},
|
|
476
|
+
dotAvatar: {
|
|
477
|
+
position: 'absolute',
|
|
478
|
+
width: 12,
|
|
479
|
+
height: 12,
|
|
480
|
+
borderRadius: 6,
|
|
481
|
+
bottom: 0,
|
|
482
|
+
right: 0,
|
|
483
|
+
borderWidth: 1,
|
|
484
|
+
borderColor: Colors.black_01,
|
|
485
|
+
},
|
|
486
|
+
headerButton: {paddingHorizontal: 4},
|
|
487
|
+
headerRightButton: {
|
|
488
|
+
flexDirection: 'row',
|
|
489
|
+
justifyContent: 'center',
|
|
490
|
+
alignItems: 'center',
|
|
491
|
+
paddingRight: Spacing.S,
|
|
492
|
+
},
|
|
493
|
+
toolkitContainer: {
|
|
494
|
+
marginLeft: Spacing.S,
|
|
495
|
+
padding: Spacing.XS,
|
|
496
|
+
height: 28,
|
|
497
|
+
borderRadius: 14,
|
|
498
|
+
borderColor: '#00000066',
|
|
499
|
+
justifyContent: 'center',
|
|
500
|
+
alignItems: 'center',
|
|
501
|
+
flexDirection: 'row',
|
|
502
|
+
},
|
|
503
|
+
divider: {
|
|
504
|
+
width: 1,
|
|
505
|
+
height: 12,
|
|
506
|
+
marginHorizontal: 4,
|
|
507
|
+
},
|
|
508
|
+
headerLeft: {
|
|
509
|
+
marginLeft: 12,
|
|
510
|
+
},
|
|
511
|
+
title: {
|
|
512
|
+
fontSize: scaleSize(15),
|
|
513
|
+
lineHeight: scaleSize(22),
|
|
514
|
+
fontWeight: 'bold',
|
|
515
|
+
},
|
|
516
|
+
badge: {
|
|
517
|
+
position: 'absolute',
|
|
518
|
+
top: -Spacing.S,
|
|
519
|
+
right: -6,
|
|
520
|
+
},
|
|
521
|
+
badgeDot: {
|
|
522
|
+
position: 'absolute',
|
|
523
|
+
top: -Spacing.XS,
|
|
524
|
+
right: -Spacing.XS,
|
|
525
|
+
},
|
|
526
|
+
});
|
|
527
|
+
|
|
524
528
|
export {
|
|
525
529
|
NavigationButton,
|
|
526
530
|
HeaderTitle,
|
|
@@ -74,7 +74,7 @@ const Modal: React.FC<ModalParams> = props => {
|
|
|
74
74
|
style={styles.modalSpaceVertical}
|
|
75
75
|
onPress={() => onDismiss()}
|
|
76
76
|
/>
|
|
77
|
-
<View style={styles.modalContent}
|
|
77
|
+
<View style={styles.modalContent}>
|
|
78
78
|
<Component {...params} />
|
|
79
79
|
</View>
|
|
80
80
|
<Pressable
|
|
@@ -167,7 +167,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
167
167
|
bottomInset={Platform.OS === 'ios' ? bottomInset : 0}
|
|
168
168
|
handleComponent={null}
|
|
169
169
|
backdropComponent={backdropComponent}>
|
|
170
|
-
<BottomSheetView
|
|
170
|
+
<BottomSheetView>
|
|
171
171
|
<View style={[styles.sheetContainer, {backgroundColor}]}>
|
|
172
172
|
<View style={styles.indicatorContainer}>
|
|
173
173
|
<View
|
|
@@ -178,7 +178,6 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
178
178
|
/>
|
|
179
179
|
</View>
|
|
180
180
|
<NavigationContainer
|
|
181
|
-
trackingInfo={navigator?.trackingInfo}
|
|
182
181
|
maxApi={navigator?.maxApi}
|
|
183
182
|
theme={{
|
|
184
183
|
...theme,
|
|
@@ -190,22 +189,11 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
190
189
|
...{
|
|
191
190
|
headerLeft: (props: any) => {
|
|
192
191
|
if (props.canGoBack) {
|
|
193
|
-
return
|
|
194
|
-
<HeaderLeft
|
|
195
|
-
{...props}
|
|
196
|
-
useBorder={false}
|
|
197
|
-
accessibilityLabel={'BottomSheet/'}
|
|
198
|
-
/>
|
|
199
|
-
);
|
|
192
|
+
return <HeaderLeft {...props} useBorder={false} />;
|
|
200
193
|
}
|
|
201
194
|
},
|
|
202
195
|
headerTitle: (props: any) => {
|
|
203
|
-
return
|
|
204
|
-
<HeaderTitle
|
|
205
|
-
{...props}
|
|
206
|
-
accessibilityLabel={'BottomSheet/'}
|
|
207
|
-
/>
|
|
208
|
-
);
|
|
196
|
+
return <HeaderTitle {...props} />;
|
|
209
197
|
},
|
|
210
198
|
headerTintColor: theme.colors.text.default,
|
|
211
199
|
headerBackground: () => (
|
|
@@ -221,7 +209,6 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
221
209
|
icon="24_navigation_close"
|
|
222
210
|
useBorder={false}
|
|
223
211
|
onPress={() => bottomSheetRef.current?.dismiss()}
|
|
224
|
-
accessibilityLabel={'BottomSheet/Close'}
|
|
225
212
|
/>
|
|
226
213
|
</HeaderRightAction>
|
|
227
214
|
),
|