@momo-kits/foundation 0.168.1-beta.39 → 0.168.1-beta.40
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 +398 -86
- package/Application/BottomTab/BottomTabBar.tsx +275 -215
- package/Application/BottomTab/CustomBottomTabItem.tsx +107 -131
- package/Application/BottomTab/DuoBarCompression.tsx +28 -14
- package/Application/BottomTab/DuoTabBar.tsx +540 -32
- package/Application/BottomTab/TabBarIcon.tsx +72 -146
- package/Application/BottomTab/index.tsx +353 -89
- package/Application/BottomTab/useLiquidSelection.ts +374 -0
- package/Application/Components/BackgroundImageView.tsx +0 -4
- package/Application/Components/DuoGlassBackground.tsx +5 -7
- package/Application/Components/HeaderAnimated.tsx +13 -41
- package/Application/Components/HeaderBackground.tsx +3 -20
- package/Application/Components/HeaderExtendHeader.tsx +46 -66
- package/Application/Components/HeaderLeft.tsx +18 -5
- package/Application/Components/HeaderRight.tsx +529 -8
- package/Application/Components/HeaderTitle.tsx +579 -16
- package/Application/Components/NavigationButton.tsx +11 -18
- package/Application/Components/SearchHeader.tsx +18 -38
- package/Application/Localize.ts +0 -7
- package/Application/ModalScreen.tsx +18 -41
- package/Application/Navigation.ts +17 -15
- package/Application/NavigationContainer.tsx +21 -23
- package/Application/Navigator.ts +48 -20
- package/Application/ScaleSizeProvider.tsx +6 -13
- package/Application/StackScreen.tsx +172 -27
- package/Application/TooltipPortal.tsx +5 -12
- package/Application/WidgetContainer.tsx +7 -20
- package/Application/device.ts +52 -0
- package/Application/index.ts +1 -23
- package/Application/types.ts +242 -17
- package/Application/utils.tsx +493 -0
- package/Badge/Badge.tsx +0 -5
- package/Badge/BadgeDot.tsx +0 -1
- package/Badge/BadgeDotAnimation.tsx +7 -15
- package/Badge/BadgeRibbon.tsx +39 -47
- package/Badge/Shape.tsx +0 -2
- package/Badge/styles.ts +0 -2
- package/Badge/types.ts +2 -2
- package/Button/index.tsx +152 -21
- package/Button/styles.ts +1 -1
- package/CheckBox/index.tsx +6 -5
- package/Consts/theme.ts +10 -10
- package/Context/index.ts +1 -5
- package/Divider/DashDivider.tsx +11 -11
- package/Divider/index.tsx +7 -21
- package/FoundationList/index.tsx +0 -4
- package/Icon/index.tsx +6 -6
- package/Icon/types.ts +1 -1
- package/IconButton/index.tsx +12 -4
- package/Image/index.tsx +7 -9
- package/Input/Input.tsx +12 -10
- package/Input/InputDropDown.tsx +13 -10
- package/Input/InputMoney.tsx +152 -45
- package/Input/InputOTP.tsx +34 -36
- package/Input/InputPhoneNumber.tsx +5 -8
- package/Input/InputSearch.tsx +111 -19
- package/Input/InputTextArea.tsx +5 -5
- package/Input/SystemTextInput.tsx +2 -7
- package/Input/TextTyping.tsx +0 -4
- package/Input/common.tsx +17 -31
- package/Input/index.tsx +21 -24
- package/Input/styles.ts +5 -25
- package/Input/utils.ts +12 -14
- package/Layout/Card.tsx +4 -7
- package/Layout/FloatingButton.tsx +21 -26
- package/Layout/Item.tsx +2 -6
- package/Layout/ItemList.tsx +7 -9
- package/Layout/ItemSectionList.tsx +1 -2
- package/Layout/ReservedRegions.tsx +17 -34
- package/Layout/Screen.tsx +696 -122
- package/Layout/Section.tsx +7 -9
- package/Layout/TrackingScope.tsx +0 -1
- package/Layout/index.ts +4 -10
- package/Layout/styles.ts +0 -2
- package/Layout/types.ts +4 -2
- package/Layout/utils.ts +181 -40
- package/Loader/DotLoader.tsx +3 -11
- package/Loader/Loader.tsx +0 -4
- package/Loader/ProgressBar.tsx +6 -3
- package/Loader/Spinner.tsx +3 -11
- package/Loader/styles.ts +0 -4
- package/Loader/utils.ts +7 -11
- package/Pagination/Dot.tsx +0 -4
- package/Pagination/PaginationDot.tsx +0 -1
- package/Pagination/PaginationNumber.tsx +3 -5
- package/Pagination/PaginationScroll.tsx +0 -5
- package/Pagination/PaginationWhiteDot.tsx +0 -1
- package/Pagination/index.tsx +0 -4
- package/Pagination/types.ts +2 -2
- package/Popup/PopupNotify.tsx +102 -94
- package/Popup/PopupPromotion.tsx +11 -9
- package/Popup/types.ts +4 -11
- package/Popup/utils.ts +18 -50
- package/Radio/index.tsx +10 -6
- package/Radio/styles.ts +0 -6
- package/Skeleton/index.tsx +9 -9
- package/Skeleton/styles.ts +0 -1
- package/Switch/index.tsx +0 -1
- package/Tag/index.tsx +4 -8
- package/Tag/types.ts +3 -3
- package/Text/index.tsx +5 -25
- package/Text/styles.ts +1 -1
- package/Text/types.ts +6 -1
- package/Text/utils.ts +4 -20
- package/Title/index.tsx +40 -42
- package/Title/styles.ts +0 -6
- package/ViewBoundary/index.tsx +2 -4
- package/index.ts +6 -0
- package/package.json +1 -2
- package/Application/BottomSheet.hooks.ts +0 -195
- package/Application/BottomSheet.parts.tsx +0 -157
- package/Application/BottomSheet.styles.ts +0 -43
- package/Application/BottomTab/ActiveIndicator.tsx +0 -91
- package/Application/BottomTab/BottomTabBar.styles.ts +0 -65
- package/Application/BottomTab/BottomTabInset.tsx +0 -18
- package/Application/BottomTab/CurvedContainer.tsx +0 -155
- package/Application/BottomTab/DuoRailTabBar.tsx +0 -223
- package/Application/BottomTab/DuoTabBar.styles.ts +0 -81
- package/Application/BottomTab/TabScreen.tsx +0 -160
- package/Application/BottomTab/metrics.ts +0 -164
- package/Application/BottomTab/tabItems.ts +0 -46
- package/Application/BottomTab/usePressLift.ts +0 -32
- package/Application/Components/HeaderRight.styles.ts +0 -146
- package/Application/Components/HeaderTitle.shared.ts +0 -44
- package/Application/Components/HeaderTitle.styles.ts +0 -125
- package/Application/Components/HeaderToolkitAction.tsx +0 -180
- package/Application/Components/SwipeBackHaptic.tsx +0 -95
- package/Application/Components/TitleJourney.tsx +0 -110
- package/Application/Components/TitleLocation.tsx +0 -73
- package/Application/Components/TitleUser.tsx +0 -304
- package/Application/Components/useToolkitActions.tsx +0 -218
- package/Application/ModalIconButton.tsx +0 -66
- package/Application/StackScreen.tracking.ts +0 -143
- package/Application/headerLayout.ts +0 -158
- package/Application/hooks.ts +0 -137
- package/Application/modalLayout.ts +0 -176
- package/Application/navigationOptions.tsx +0 -212
- package/Application/types.header.ts +0 -121
- package/Application/types.tabs.ts +0 -48
- package/Application/types.theme.ts +0 -87
- package/Application/utils.ts +0 -107
- package/Button/utils.ts +0 -133
- package/Input/InputMoneyView.tsx +0 -194
- package/Input/SearchTextTyping.tsx +0 -108
- package/Input/moneyUtils.ts +0 -23
- package/Layout/layoutMetrics.ts +0 -58
- package/Layout/layoutTypes.ts +0 -86
- package/Layout/screenContent.tsx +0 -92
- package/Layout/screenFooter.tsx +0 -63
- package/Layout/screenHeader.tsx +0 -321
- package/Layout/screenQuickReturn.tsx +0 -64
- package/Layout/screenScroll.ts +0 -107
- package/Layout/screenTypes.ts +0 -143
|
@@ -1,16 +1,31 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import React, { useCallback, useContext, useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Platform,
|
|
4
|
+
StyleSheet,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
View,
|
|
7
|
+
ViewStyle,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import { NavigationButton } from './NavigationButton';
|
|
10
|
+
import { ApplicationContext, MiniAppContext } from '../../Context';
|
|
11
|
+
import { Colors, Spacing, Styles } from '../../Consts';
|
|
12
|
+
import { PopupNotify } from '../../Popup';
|
|
13
|
+
import { Tool, ToolGroup } from '../types';
|
|
14
|
+
import { Icon } from '../../Icon';
|
|
4
15
|
import { Text } from '../../Text';
|
|
5
16
|
import Animated from 'react-native-reanimated';
|
|
6
|
-
import { useSideBarItemStyle } from '../../Layout/utils';
|
|
17
|
+
import { useScreenLayout, useSideBarItemStyle } from '../../Layout/utils';
|
|
7
18
|
import { useSideBarCounterStyle } from './DuoQuickReturnHeader';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
19
|
+
import { SideBarButton, SideBarGroup, SideBarGroupItem } from './SideBarButton';
|
|
20
|
+
import { useDuoBarCompression } from '../BottomTab/DuoBarCompression';
|
|
21
|
+
import { DuoMetrics } from '../../Layout/utils';
|
|
22
|
+
|
|
23
|
+
const DID_SYNC_NEW_HOME = 'did_sync_new_home';
|
|
24
|
+
const CLOSE_ICON = '16_navigation_close_circle';
|
|
25
|
+
const HOME_ICON = '16_basic_home';
|
|
10
26
|
|
|
11
27
|
/**
|
|
12
|
-
*
|
|
13
|
-
* button, or the toolkit (stacked vertically in the floating iPhone Duo side bar).
|
|
28
|
+
* main component for header right
|
|
14
29
|
*/
|
|
15
30
|
const HeaderRight: React.FC<any> = props => {
|
|
16
31
|
const { translate } = useContext(ApplicationContext);
|
|
@@ -55,4 +70,510 @@ const HeaderRight: React.FC<any> = props => {
|
|
|
55
70
|
);
|
|
56
71
|
};
|
|
57
72
|
|
|
73
|
+
/**
|
|
74
|
+
* Header toolkit action
|
|
75
|
+
*/
|
|
76
|
+
const HeaderToolkitAction: React.FC<any> = ({
|
|
77
|
+
tintColor,
|
|
78
|
+
preventClose,
|
|
79
|
+
useSystemTools = true,
|
|
80
|
+
useShortcut = false,
|
|
81
|
+
useMore = false,
|
|
82
|
+
tools = [],
|
|
83
|
+
useCloseIcon = false,
|
|
84
|
+
vertical = false,
|
|
85
|
+
}) => {
|
|
86
|
+
const { navigator } = useContext(ApplicationContext);
|
|
87
|
+
const context = useContext<any>(MiniAppContext);
|
|
88
|
+
const { toolbarCompressed, toolbarHidden, expandToolbar, setToolbarHeight } =
|
|
89
|
+
useDuoBarCompression();
|
|
90
|
+
const { statusBarClearance } = useScreenLayout();
|
|
91
|
+
|
|
92
|
+
const [isFavorite, setIsFavorite] = useState<boolean>(false);
|
|
93
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* check app is favorite
|
|
97
|
+
*/
|
|
98
|
+
const checkAppIsFavorite = useCallback(
|
|
99
|
+
() =>
|
|
100
|
+
navigator?.maxApi?.dispatchFunction?.(
|
|
101
|
+
'isFavoriteApp',
|
|
102
|
+
{ code: context?.code },
|
|
103
|
+
(result: boolean) => {
|
|
104
|
+
setIsFavorite(result);
|
|
105
|
+
},
|
|
106
|
+
),
|
|
107
|
+
[context?.code, navigator?.maxApi],
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (useShortcut) {
|
|
112
|
+
checkAppIsFavorite();
|
|
113
|
+
|
|
114
|
+
const favoriteObserver = navigator?.maxApi?.observer?.(
|
|
115
|
+
DID_SYNC_NEW_HOME,
|
|
116
|
+
(updatedData: any) => {
|
|
117
|
+
const status = updatedData?.items?.includes(context?.code);
|
|
118
|
+
setIsFavorite(status);
|
|
119
|
+
},
|
|
120
|
+
);
|
|
121
|
+
return () => {
|
|
122
|
+
favoriteObserver?.remove?.();
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}, [useShortcut, context, checkAppIsFavorite, navigator?.maxApi]);
|
|
126
|
+
|
|
127
|
+
let buttonStyle: ViewStyle = {};
|
|
128
|
+
if (tintColor === Colors.black_01 || tintColor === 'white') {
|
|
129
|
+
buttonStyle = {
|
|
130
|
+
backgroundColor: '#00000099',
|
|
131
|
+
borderColor: '#FFFFFF33',
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const onDismiss = () => {
|
|
136
|
+
if (useCloseIcon) {
|
|
137
|
+
navigator?.maxApi?.dispatchFunction?.(
|
|
138
|
+
'dismiss',
|
|
139
|
+
navigator?.dismissData,
|
|
140
|
+
undefined,
|
|
141
|
+
);
|
|
142
|
+
} else {
|
|
143
|
+
navigator?.maxApi?.dispatchFunction?.('dismissAll');
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* close navigation container
|
|
149
|
+
*/
|
|
150
|
+
const onClose = () => {
|
|
151
|
+
const currentRoute = navigator?.ref?.current?.getCurrentRoute?.();
|
|
152
|
+
context?.autoTracking?.({
|
|
153
|
+
...context,
|
|
154
|
+
componentName: 'IconButton',
|
|
155
|
+
componentId: 'navigation_close',
|
|
156
|
+
screenName: currentRoute?.params?.screen?.name ?? currentRoute?.name,
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
if (preventClose) {
|
|
160
|
+
navigator?.showModal({
|
|
161
|
+
screen: () => (
|
|
162
|
+
<PopupNotify
|
|
163
|
+
{...preventClose}
|
|
164
|
+
primary={{
|
|
165
|
+
title: preventClose.primary.title,
|
|
166
|
+
onPress: () => {
|
|
167
|
+
preventClose?.primary.onPress();
|
|
168
|
+
onDismiss();
|
|
169
|
+
},
|
|
170
|
+
}}
|
|
171
|
+
/>
|
|
172
|
+
),
|
|
173
|
+
});
|
|
174
|
+
} else {
|
|
175
|
+
onDismiss();
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* on press shortcut
|
|
181
|
+
*/
|
|
182
|
+
const onPressShortcut = () => {
|
|
183
|
+
const currentRoute = navigator?.ref?.current?.getCurrentRoute?.();
|
|
184
|
+
const expected = !isFavorite;
|
|
185
|
+
context?.autoTracking?.({
|
|
186
|
+
...context,
|
|
187
|
+
componentName: 'IconButton',
|
|
188
|
+
componentId: `${expected ? 'pin' : 'unpin'}_shortcut`,
|
|
189
|
+
screenName: currentRoute?.params?.screen?.name ?? currentRoute?.name,
|
|
190
|
+
});
|
|
191
|
+
setIsLoading(true);
|
|
192
|
+
navigator?.maxApi?.dispatchFunction?.(
|
|
193
|
+
'onToolAction',
|
|
194
|
+
{
|
|
195
|
+
item: {
|
|
196
|
+
key: 'onFavorite',
|
|
197
|
+
},
|
|
198
|
+
context,
|
|
199
|
+
},
|
|
200
|
+
({ success }: { success: boolean }) => {
|
|
201
|
+
if (success) {
|
|
202
|
+
setIsFavorite(expected);
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
);
|
|
206
|
+
setTimeout(() => {
|
|
207
|
+
setIsLoading(false);
|
|
208
|
+
}, 1000);
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* on press help center
|
|
213
|
+
*/
|
|
214
|
+
const onPressHelpCenter = () => {
|
|
215
|
+
const currentRoute = navigator?.ref?.current?.getCurrentRoute?.();
|
|
216
|
+
context?.autoTracking?.({
|
|
217
|
+
...context,
|
|
218
|
+
componentName: 'IconButton',
|
|
219
|
+
componentId: 'navigation_helpcenter',
|
|
220
|
+
screenName: currentRoute?.params?.screen?.name ?? currentRoute?.name,
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
navigator?.maxApi?.dispatchFunction?.('showHelpCenter', context);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* on press icon more
|
|
228
|
+
*/
|
|
229
|
+
const onPressIconMore = () => {
|
|
230
|
+
const currentRoute = navigator?.ref?.current?.getCurrentRoute?.();
|
|
231
|
+
context?.autoTracking?.({
|
|
232
|
+
...context,
|
|
233
|
+
componentName: 'IconButton',
|
|
234
|
+
componentId: 'navigation_more',
|
|
235
|
+
screenName: currentRoute?.params?.screen?.name ?? currentRoute?.name,
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
navigator?.maxApi?.dispatchFunction?.(
|
|
239
|
+
'showTools',
|
|
240
|
+
{
|
|
241
|
+
useSystemTools,
|
|
242
|
+
tools,
|
|
243
|
+
context,
|
|
244
|
+
},
|
|
245
|
+
(key: string) => {
|
|
246
|
+
for (const group of tools) {
|
|
247
|
+
const pressedTool = group?.items?.find?.(
|
|
248
|
+
(tool: Tool) => tool?.key === key,
|
|
249
|
+
);
|
|
250
|
+
if (pressedTool) {
|
|
251
|
+
pressedTool?.onPress();
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
let iconShortcut = isFavorite ? 'pin_star_checked' : 'pin_star';
|
|
260
|
+
let shortcutOnPress = onPressShortcut;
|
|
261
|
+
const totalTools = tools.reduce(
|
|
262
|
+
(count: number, group: ToolGroup) => count + group?.items?.length,
|
|
263
|
+
0,
|
|
264
|
+
);
|
|
265
|
+
const showIconMore = tools && totalTools > 1;
|
|
266
|
+
const isHaveOneTool = tools && totalTools === 1;
|
|
267
|
+
|
|
268
|
+
if (showIconMore || useMore) {
|
|
269
|
+
iconShortcut = 'navigation_more_icon';
|
|
270
|
+
shortcutOnPress = onPressIconMore;
|
|
271
|
+
} else if (isHaveOneTool) {
|
|
272
|
+
const singleTool = tools.find(
|
|
273
|
+
(group: ToolGroup) => group?.items?.length === 1,
|
|
274
|
+
)?.items[0];
|
|
275
|
+
iconShortcut = singleTool?.icon;
|
|
276
|
+
shortcutOnPress = () => {
|
|
277
|
+
singleTool?.onPress?.();
|
|
278
|
+
const currentRoute = navigator?.ref?.current?.getCurrentRoute?.();
|
|
279
|
+
context?.autoTracking?.({
|
|
280
|
+
...context,
|
|
281
|
+
componentName: 'IconButton',
|
|
282
|
+
componentId: 'navigation_shortcut',
|
|
283
|
+
screenName: currentRoute?.params?.screen?.name ?? currentRoute?.name,
|
|
284
|
+
});
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const showBadge = tools.some((group: ToolGroup) =>
|
|
289
|
+
group?.items?.some?.(tool => tool?.showBadge),
|
|
290
|
+
);
|
|
291
|
+
|
|
292
|
+
const useHelpCenter = context.appId !== 'vn.momo.helpcenter';
|
|
293
|
+
const closeIcon = useCloseIcon ? CLOSE_ICON : HOME_ICON;
|
|
294
|
+
|
|
295
|
+
const groupCount = useHelpCenter ? 2 : 1;
|
|
296
|
+
let capsuleHeight = DuoMetrics.controlSize;
|
|
297
|
+
if (groupCount > 1) {
|
|
298
|
+
capsuleHeight = groupCount * DuoMetrics.itemPitch;
|
|
299
|
+
}
|
|
300
|
+
// Back slot, the optional shortcut, then the help/home capsule
|
|
301
|
+
const fullToolbarHeight =
|
|
302
|
+
DuoMetrics.controlSize +
|
|
303
|
+
Spacing.M +
|
|
304
|
+
(useShortcut ? DuoMetrics.controlSize + Spacing.M : 0) +
|
|
305
|
+
capsuleHeight;
|
|
306
|
+
|
|
307
|
+
useEffect(() => {
|
|
308
|
+
if (vertical) {
|
|
309
|
+
setToolbarHeight?.(fullToolbarHeight);
|
|
310
|
+
}
|
|
311
|
+
}, [vertical, fullToolbarHeight, setToolbarHeight]);
|
|
312
|
+
|
|
313
|
+
// an open tab rail takes this slot for a moment
|
|
314
|
+
if (vertical && toolbarHidden) {
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// HIG "Toolbar compressed": tools fold into one button; tapping it expands the
|
|
319
|
+
// toolbar and compresses the tab bar instead. Not the useMore icon, to tell them apart
|
|
320
|
+
if (vertical && toolbarCompressed) {
|
|
321
|
+
return (
|
|
322
|
+
<SideBarButton
|
|
323
|
+
accessibilityLabel={'btn_navigation_toolbar'}
|
|
324
|
+
icon={'navigation_menu'}
|
|
325
|
+
tintColor={tintColor}
|
|
326
|
+
showBadge={showBadge}
|
|
327
|
+
onPress={expandToolbar}
|
|
328
|
+
/>
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (vertical) {
|
|
333
|
+
return (
|
|
334
|
+
<View style={styles.sideBarColumn}>
|
|
335
|
+
{useShortcut && (
|
|
336
|
+
<SideBarButton
|
|
337
|
+
disabled={isLoading}
|
|
338
|
+
icon={iconShortcut}
|
|
339
|
+
onPress={shortcutOnPress}
|
|
340
|
+
tintColor={tintColor}
|
|
341
|
+
showBadge={showBadge}
|
|
342
|
+
/>
|
|
343
|
+
)}
|
|
344
|
+
<SideBarGroup tintColor={tintColor}>
|
|
345
|
+
{useHelpCenter && (
|
|
346
|
+
<SideBarGroupItem
|
|
347
|
+
accessibilityLabel={'btn_navigation_help_center'}
|
|
348
|
+
icon={'help_center'}
|
|
349
|
+
tintColor={tintColor}
|
|
350
|
+
onPress={onPressHelpCenter}
|
|
351
|
+
/>
|
|
352
|
+
)}
|
|
353
|
+
<SideBarGroupItem
|
|
354
|
+
accessibilityLabel={'btn_navigation_close'}
|
|
355
|
+
icon={closeIcon}
|
|
356
|
+
tintColor={tintColor}
|
|
357
|
+
onPress={onClose}
|
|
358
|
+
/>
|
|
359
|
+
</SideBarGroup>
|
|
360
|
+
</View>
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// on the status bar row the controls keep the side bar size
|
|
365
|
+
if (statusBarClearance) {
|
|
366
|
+
return (
|
|
367
|
+
<View style={styles.sideBarRow}>
|
|
368
|
+
{useShortcut && (
|
|
369
|
+
<SideBarButton
|
|
370
|
+
disabled={isLoading}
|
|
371
|
+
icon={iconShortcut}
|
|
372
|
+
onPress={shortcutOnPress}
|
|
373
|
+
tintColor={tintColor}
|
|
374
|
+
showBadge={showBadge}
|
|
375
|
+
/>
|
|
376
|
+
)}
|
|
377
|
+
<SideBarGroup tintColor={tintColor} horizontal>
|
|
378
|
+
{useHelpCenter && (
|
|
379
|
+
<SideBarGroupItem
|
|
380
|
+
accessibilityLabel={'btn_navigation_help_center'}
|
|
381
|
+
icon={'help_center'}
|
|
382
|
+
tintColor={tintColor}
|
|
383
|
+
onPress={onPressHelpCenter}
|
|
384
|
+
/>
|
|
385
|
+
)}
|
|
386
|
+
<SideBarGroupItem
|
|
387
|
+
accessibilityLabel={'btn_navigation_close'}
|
|
388
|
+
icon={closeIcon}
|
|
389
|
+
tintColor={tintColor}
|
|
390
|
+
onPress={onClose}
|
|
391
|
+
/>
|
|
392
|
+
</SideBarGroup>
|
|
393
|
+
</View>
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
return (
|
|
398
|
+
<View style={Styles.row}>
|
|
399
|
+
{useShortcut && (
|
|
400
|
+
<NavigationButton
|
|
401
|
+
disabled={isLoading}
|
|
402
|
+
icon={iconShortcut}
|
|
403
|
+
onPress={shortcutOnPress}
|
|
404
|
+
tintColor={tintColor}
|
|
405
|
+
showBadge={showBadge}
|
|
406
|
+
/>
|
|
407
|
+
)}
|
|
408
|
+
<View
|
|
409
|
+
style={[
|
|
410
|
+
styles.toolkitContainer,
|
|
411
|
+
buttonStyle,
|
|
412
|
+
{
|
|
413
|
+
width: context.appId !== 'vn.momo.helpcenter' ? 65 : 28,
|
|
414
|
+
},
|
|
415
|
+
]}
|
|
416
|
+
>
|
|
417
|
+
{useHelpCenter && (
|
|
418
|
+
<>
|
|
419
|
+
<TouchableOpacity
|
|
420
|
+
accessibilityLabel={'btn_navigation_help_center'}
|
|
421
|
+
style={styles.toolkitButton}
|
|
422
|
+
onPress={onPressHelpCenter}
|
|
423
|
+
hitSlop={{ top: 7, bottom: 7, left: 7, right: 0 }}
|
|
424
|
+
>
|
|
425
|
+
<Icon color={tintColor} source={'help_center'} size={20} />
|
|
426
|
+
</TouchableOpacity>
|
|
427
|
+
<View style={[styles.divider, { backgroundColor: tintColor }]} />
|
|
428
|
+
</>
|
|
429
|
+
)}
|
|
430
|
+
<TouchableOpacity
|
|
431
|
+
accessibilityLabel={'btn_navigation_close'}
|
|
432
|
+
onPress={onClose}
|
|
433
|
+
style={styles.toolkitButton}
|
|
434
|
+
hitSlop={{ top: 7, bottom: 7, left: 0, right: 7 }}
|
|
435
|
+
>
|
|
436
|
+
<Icon color={tintColor} source={closeIcon} size={20} />
|
|
437
|
+
</TouchableOpacity>
|
|
438
|
+
</View>
|
|
439
|
+
</View>
|
|
440
|
+
);
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
const styles = StyleSheet.create({
|
|
444
|
+
navigationButton: {
|
|
445
|
+
height: 28,
|
|
446
|
+
width: 28,
|
|
447
|
+
borderRadius: 14,
|
|
448
|
+
justifyContent: 'center',
|
|
449
|
+
alignItems: 'center',
|
|
450
|
+
backgroundColor: '#FFFFFF99',
|
|
451
|
+
borderColor: '#00000033',
|
|
452
|
+
borderWidth: 0.2,
|
|
453
|
+
},
|
|
454
|
+
headerBackground: {
|
|
455
|
+
width: '100%',
|
|
456
|
+
height: undefined,
|
|
457
|
+
position: 'absolute',
|
|
458
|
+
aspectRatio: 375 / 154,
|
|
459
|
+
},
|
|
460
|
+
headerTitleContainer: {
|
|
461
|
+
alignItems: 'center',
|
|
462
|
+
justifyContent: 'center',
|
|
463
|
+
width: '70%',
|
|
464
|
+
},
|
|
465
|
+
circle: {
|
|
466
|
+
width: 32,
|
|
467
|
+
height: 32,
|
|
468
|
+
borderRadius: 16,
|
|
469
|
+
borderWidth: 0.5,
|
|
470
|
+
borderColor: Colors.black_04,
|
|
471
|
+
},
|
|
472
|
+
dotAvatar: {
|
|
473
|
+
position: 'absolute',
|
|
474
|
+
width: 12,
|
|
475
|
+
height: 12,
|
|
476
|
+
borderRadius: 6,
|
|
477
|
+
bottom: -2,
|
|
478
|
+
right: -2,
|
|
479
|
+
borderWidth: 2,
|
|
480
|
+
borderColor: Colors.black_01,
|
|
481
|
+
},
|
|
482
|
+
headerButton: { paddingHorizontal: 4 },
|
|
483
|
+
headerRightButton: {
|
|
484
|
+
flexDirection: 'row',
|
|
485
|
+
justifyContent: 'center',
|
|
486
|
+
alignItems: 'center',
|
|
487
|
+
paddingRight: Spacing.M,
|
|
488
|
+
},
|
|
489
|
+
toolkitContainer: {
|
|
490
|
+
height: 28,
|
|
491
|
+
borderRadius: 14,
|
|
492
|
+
justifyContent: 'center',
|
|
493
|
+
alignItems: 'center',
|
|
494
|
+
flexDirection: 'row',
|
|
495
|
+
backgroundColor: '#FFFFFF99',
|
|
496
|
+
borderColor: '#00000033',
|
|
497
|
+
borderWidth: 0.2,
|
|
498
|
+
marginLeft: Spacing.S,
|
|
499
|
+
},
|
|
500
|
+
toolkitButton: {
|
|
501
|
+
padding: 4,
|
|
502
|
+
},
|
|
503
|
+
divider: {
|
|
504
|
+
width: 0.5,
|
|
505
|
+
height: 12,
|
|
506
|
+
},
|
|
507
|
+
sideBarColumn: {
|
|
508
|
+
gap: Spacing.M,
|
|
509
|
+
},
|
|
510
|
+
sideBarRow: {
|
|
511
|
+
flexDirection: 'row',
|
|
512
|
+
gap: Spacing.M,
|
|
513
|
+
},
|
|
514
|
+
headerLeft: {
|
|
515
|
+
marginLeft: 12,
|
|
516
|
+
},
|
|
517
|
+
badge: {
|
|
518
|
+
position: 'absolute',
|
|
519
|
+
top: -Spacing.S,
|
|
520
|
+
right: -6,
|
|
521
|
+
},
|
|
522
|
+
badgeDot: {
|
|
523
|
+
position: 'absolute',
|
|
524
|
+
top: -Spacing.XXS,
|
|
525
|
+
right: -Spacing.XXS,
|
|
526
|
+
},
|
|
527
|
+
badgeDotAnimation: {
|
|
528
|
+
position: 'absolute',
|
|
529
|
+
top: -Spacing.XS,
|
|
530
|
+
right: -Spacing.XS,
|
|
531
|
+
},
|
|
532
|
+
gradientContainer: {
|
|
533
|
+
width: '100%',
|
|
534
|
+
height: '100%',
|
|
535
|
+
position: 'absolute',
|
|
536
|
+
overflow: 'hidden',
|
|
537
|
+
},
|
|
538
|
+
extendedHeader: {
|
|
539
|
+
aspectRatio: 2.43,
|
|
540
|
+
position: 'absolute',
|
|
541
|
+
width: '100%',
|
|
542
|
+
},
|
|
543
|
+
verifiedDot: {
|
|
544
|
+
width: 4,
|
|
545
|
+
height: 4,
|
|
546
|
+
borderRadius: 2,
|
|
547
|
+
backgroundColor: Colors.green_03,
|
|
548
|
+
position: 'absolute',
|
|
549
|
+
alignSelf: 'center',
|
|
550
|
+
},
|
|
551
|
+
shadowHeader: {
|
|
552
|
+
...Platform.select({
|
|
553
|
+
ios: {
|
|
554
|
+
shadowColor: Colors.black_20,
|
|
555
|
+
shadowOffset: {
|
|
556
|
+
width: 3,
|
|
557
|
+
height: 3,
|
|
558
|
+
},
|
|
559
|
+
shadowOpacity: 0.12,
|
|
560
|
+
shadowRadius: 10,
|
|
561
|
+
},
|
|
562
|
+
android: {
|
|
563
|
+
shadowColor: Colors.black_17,
|
|
564
|
+
shadowOffset: {
|
|
565
|
+
width: 3,
|
|
566
|
+
height: 3,
|
|
567
|
+
},
|
|
568
|
+
shadowOpacity: 0.12,
|
|
569
|
+
shadowRadius: 10,
|
|
570
|
+
elevation: 10,
|
|
571
|
+
},
|
|
572
|
+
}),
|
|
573
|
+
},
|
|
574
|
+
onBoarding: {
|
|
575
|
+
marginRight: Spacing.M,
|
|
576
|
+
},
|
|
577
|
+
});
|
|
578
|
+
|
|
58
579
|
export { HeaderRight };
|