@momo-kits/foundation 0.77.8 → 0.78.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.tsx +13 -3
- package/Application/Components.tsx +51 -4
- package/Application/ModalScreen.tsx +43 -15
- package/Application/Navigation.ts +4 -2
- package/Application/NavigationContainer.tsx +22 -1
- package/Application/index.ts +8 -2
- package/Application/types.ts +19 -15
- package/Application/utils.tsx +13 -0
- package/Assets/DotAnimation.json +256 -0
- package/Assets/SpinnerAnimation.json +1027 -0
- package/Button/index.tsx +25 -14
- package/CheckBox/index.tsx +29 -24
- package/CheckBox/styles.ts +1 -1
- package/CheckBox/types.ts +1 -1
- package/Consts/styles.ts +0 -26
- package/Divider/index.tsx +2 -0
- package/Input/Input.tsx +126 -106
- package/Input/InputMoney.tsx +118 -110
- package/Input/InputSearch.tsx +129 -134
- package/Input/InputTextArea.tsx +126 -118
- package/Input/common.tsx +11 -5
- package/Input/index.tsx +12 -0
- package/Layout/Card.tsx +9 -2
- package/Layout/GridSystem.tsx +1 -1
- package/Layout/Item.tsx +15 -2
- package/Layout/Screen.tsx +76 -8
- package/Layout/Section.tsx +36 -3
- package/Layout/index.ts +1 -1
- package/Layout/types.ts +0 -37
- package/Layout/utils.ts +6 -9
- package/Loader/DotLoader.tsx +37 -0
- package/Loader/Loader.tsx +13 -0
- package/Loader/ProgressBar.tsx +44 -0
- package/Loader/Spinner.tsx +29 -0
- package/Loader/index.tsx +4 -0
- package/Loader/styles.ts +10 -0
- package/Loader/types.ts +35 -0
- package/Loader/utils.ts +25 -0
- package/Pagination/PaginationNumber.tsx +1 -2
- package/Pagination/PaginationWhiteDot.tsx +1 -3
- package/Popup/PopupNotify.tsx +11 -17
- package/Popup/PopupPromotion.tsx +19 -13
- package/Popup/types.ts +9 -1
- package/Radio/index.tsx +1 -1
- package/Skeleton/types.ts +3 -0
- package/Text/index.tsx +1 -16
- package/Text/utils.ts +1 -1
- package/code-scanner.js +51 -0
- package/index.ts +2 -0
- package/package.json +8 -4
- package/tsconfig.json +25 -0
- package/Application/NavigationButton.tsx +0 -54
|
@@ -8,17 +8,27 @@ import {ApplicationContext} from './index';
|
|
|
8
8
|
|
|
9
9
|
const Tab = createBottomTabNavigator();
|
|
10
10
|
|
|
11
|
-
const BottomTab: React.FC<BottomTabProps> = ({tabs, listeners}) => {
|
|
11
|
+
const BottomTab: React.FC<BottomTabProps> = ({tabs, listeners, navigation}) => {
|
|
12
12
|
const {theme} = useContext(ApplicationContext);
|
|
13
|
+
|
|
14
|
+
const defaultListener = {
|
|
15
|
+
focus: (item: any) => {
|
|
16
|
+
const focusItem = tabs.find(i => item.target.includes(i.name));
|
|
17
|
+
if (focusItem?.options) {
|
|
18
|
+
navigation?.setOptions?.(focusItem.options);
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
13
23
|
return (
|
|
14
|
-
<Tab.Navigator>
|
|
24
|
+
<Tab.Navigator backBehavior={'firstRoute'}>
|
|
15
25
|
{tabs.map(item => {
|
|
16
26
|
return (
|
|
17
27
|
<Tab.Screen
|
|
18
28
|
key={item.name}
|
|
19
29
|
name={item.name}
|
|
20
30
|
component={item.screen}
|
|
21
|
-
listeners={listeners}
|
|
31
|
+
listeners={listeners ?? defaultListener}
|
|
22
32
|
options={{
|
|
23
33
|
tabBarLabel: ({color, focused}) => {
|
|
24
34
|
return (
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, {useContext, useEffect, useState} from 'react';
|
|
2
2
|
import {
|
|
3
|
+
Alert,
|
|
3
4
|
Animated,
|
|
4
5
|
DeviceEventEmitter,
|
|
5
6
|
StatusBar,
|
|
@@ -7,13 +8,14 @@ import {
|
|
|
7
8
|
TouchableOpacity,
|
|
8
9
|
View,
|
|
9
10
|
} from 'react-native';
|
|
10
|
-
import {ApplicationContext
|
|
11
|
+
import {ApplicationContext} from './index';
|
|
11
12
|
import {Colors, Radius, Spacing, Styles} from '../Consts';
|
|
12
13
|
import {Image} from '../Image';
|
|
13
14
|
import {
|
|
14
15
|
HeaderBackgroundProps,
|
|
15
16
|
HeaderBackProps,
|
|
16
17
|
HeaderToolkitProps,
|
|
18
|
+
NavigationButtonProps,
|
|
17
19
|
TitleCustomProps,
|
|
18
20
|
} from './types';
|
|
19
21
|
import {scaleSize, Text} from '../Text';
|
|
@@ -21,6 +23,14 @@ import {Icon} from '../Icon';
|
|
|
21
23
|
import {PopupNotify} from '../Popup';
|
|
22
24
|
|
|
23
25
|
const styles = StyleSheet.create({
|
|
26
|
+
navigationButton: {
|
|
27
|
+
height: 28,
|
|
28
|
+
width: 28,
|
|
29
|
+
borderRadius: 14,
|
|
30
|
+
borderColor: '#00000066',
|
|
31
|
+
justifyContent: 'center',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
},
|
|
24
34
|
headerBackground: {
|
|
25
35
|
width: '100%',
|
|
26
36
|
height: undefined,
|
|
@@ -77,6 +87,39 @@ const styles = StyleSheet.create({
|
|
|
77
87
|
},
|
|
78
88
|
});
|
|
79
89
|
|
|
90
|
+
const NavigationButton: React.FC<NavigationButtonProps> = ({
|
|
91
|
+
icon,
|
|
92
|
+
tintColor,
|
|
93
|
+
onPress,
|
|
94
|
+
backgroundColor,
|
|
95
|
+
useBorder = true,
|
|
96
|
+
accessibilityLabel,
|
|
97
|
+
}) => {
|
|
98
|
+
const {theme} = useContext(ApplicationContext);
|
|
99
|
+
if (!backgroundColor && tintColor != Colors.black_01) {
|
|
100
|
+
backgroundColor = theme.colors.background.surface;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<TouchableOpacity
|
|
105
|
+
accessibilityLabel={`NavigationButton/${accessibilityLabel}`}
|
|
106
|
+
style={[
|
|
107
|
+
styles.navigationButton,
|
|
108
|
+
{
|
|
109
|
+
backgroundColor: backgroundColor ?? '#00000066',
|
|
110
|
+
borderWidth: useBorder && backgroundColor ? 0.5 : 0,
|
|
111
|
+
},
|
|
112
|
+
]}
|
|
113
|
+
onPress={onPress}>
|
|
114
|
+
<Icon
|
|
115
|
+
source={icon}
|
|
116
|
+
color={tintColor ?? theme.colors.text.default}
|
|
117
|
+
size={20}
|
|
118
|
+
/>
|
|
119
|
+
</TouchableOpacity>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
80
123
|
const HeaderTitle: React.FC<any> = ({accessibilityLabel = '', ...props}) => {
|
|
81
124
|
const {theme} = useContext(ApplicationContext);
|
|
82
125
|
const opacity = props.animatedValue?.interpolate({
|
|
@@ -100,6 +143,7 @@ const HeaderTitle: React.FC<any> = ({accessibilityLabel = '', ...props}) => {
|
|
|
100
143
|
const HeaderLeft: React.FC<HeaderBackProps> = ({
|
|
101
144
|
tintColor,
|
|
102
145
|
preventBack,
|
|
146
|
+
onPressLeftHeader,
|
|
103
147
|
useBorder,
|
|
104
148
|
backgroundColor,
|
|
105
149
|
accessibilityLabel = '',
|
|
@@ -131,6 +175,7 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
|
|
|
131
175
|
const requestId = `navigationBackPress#${currentTime}`;
|
|
132
176
|
DeviceEventEmitter.emit('dismiss', {requestId});
|
|
133
177
|
}
|
|
178
|
+
onPressLeftHeader?.();
|
|
134
179
|
};
|
|
135
180
|
|
|
136
181
|
return (
|
|
@@ -204,7 +249,7 @@ const HeaderCustom: React.FC<TitleCustomProps> = ({
|
|
|
204
249
|
<View style={[styles.dotAvatar, {backgroundColor: dotColor}]} />
|
|
205
250
|
)}
|
|
206
251
|
</View>
|
|
207
|
-
<View style={[Styles.flex,
|
|
252
|
+
<View style={[Styles.flex, {paddingHorizontal: 8}]}>
|
|
208
253
|
<Text typography="title_xs" color={tintColor}>
|
|
209
254
|
{title}
|
|
210
255
|
</Text>
|
|
@@ -220,8 +265,9 @@ const HeaderCustom: React.FC<TitleCustomProps> = ({
|
|
|
220
265
|
const HeaderRightAction: React.FC<any> = ({children, ...restProps}) => {
|
|
221
266
|
const validType = (item: any) => {
|
|
222
267
|
if (__DEV__ && item.type !== NavigationButton) {
|
|
223
|
-
|
|
224
|
-
'
|
|
268
|
+
Alert.alert(
|
|
269
|
+
'Rule',
|
|
270
|
+
'HeaderRightAction contains element type of NavigationButton, Please check again.',
|
|
225
271
|
);
|
|
226
272
|
return <View />;
|
|
227
273
|
}
|
|
@@ -366,6 +412,7 @@ const HeaderToolkitAction: React.FC<any> = ({tintColor}) => {
|
|
|
366
412
|
};
|
|
367
413
|
|
|
368
414
|
export {
|
|
415
|
+
NavigationButton,
|
|
369
416
|
HeaderTitle,
|
|
370
417
|
HeaderLeft,
|
|
371
418
|
HeaderBackground,
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
useCallback,
|
|
3
|
+
useContext,
|
|
4
|
+
useEffect,
|
|
5
|
+
useMemo,
|
|
6
|
+
useRef,
|
|
7
|
+
useState,
|
|
8
|
+
} from 'react';
|
|
2
9
|
import {
|
|
3
10
|
KeyboardAvoidingView,
|
|
4
11
|
Platform,
|
|
@@ -6,9 +13,8 @@ import {
|
|
|
6
13
|
StyleSheet,
|
|
7
14
|
View,
|
|
8
15
|
} from 'react-native';
|
|
9
|
-
import {SafeAreaView
|
|
16
|
+
import {SafeAreaView} from 'react-native-safe-area-context';
|
|
10
17
|
import {BottomSheetBackdrop, BottomSheetModal} from '@gorhom/bottom-sheet';
|
|
11
|
-
import {BottomSheetModalMethods} from '@gorhom/bottom-sheet/lib/typescript/types';
|
|
12
18
|
import Navigation from './Navigation';
|
|
13
19
|
import {BottomSheetParams, ModalParams} from './types';
|
|
14
20
|
import {Radius, Spacing, Styles} from '../Consts';
|
|
@@ -85,7 +91,11 @@ const Modal: React.FC<ModalParams> = props => {
|
|
|
85
91
|
|
|
86
92
|
const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
87
93
|
const {theme, navigator} = useContext(ApplicationContext);
|
|
88
|
-
const {
|
|
94
|
+
const {
|
|
95
|
+
screen,
|
|
96
|
+
options,
|
|
97
|
+
useSnap = true,
|
|
98
|
+
}: BottomSheetParams = props.route.params;
|
|
89
99
|
const Component = useRef(screen).current;
|
|
90
100
|
const navigation = new Navigation(props.navigation, theme);
|
|
91
101
|
const params = {
|
|
@@ -95,11 +105,36 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
95
105
|
|
|
96
106
|
delete params.screen;
|
|
97
107
|
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
|
|
108
|
+
const [contentHeight, setContentHeight] = useState(undefined);
|
|
109
|
+
const snapPoints = useMemo(() => {
|
|
110
|
+
if (useSnap) {
|
|
111
|
+
return ['50%', '90%'];
|
|
112
|
+
}
|
|
113
|
+
return [contentHeight ?? '50%'];
|
|
114
|
+
}, [contentHeight]);
|
|
115
|
+
|
|
116
|
+
const bottomSheetRef = useRef<any>(null);
|
|
101
117
|
const mountedRef = useRef(true);
|
|
102
118
|
|
|
119
|
+
let handleOnLayout;
|
|
120
|
+
if (useSnap) {
|
|
121
|
+
handleOnLayout = useCallback(
|
|
122
|
+
({
|
|
123
|
+
nativeEvent: {
|
|
124
|
+
layout: {height},
|
|
125
|
+
},
|
|
126
|
+
}) => {
|
|
127
|
+
setContentHeight(height);
|
|
128
|
+
},
|
|
129
|
+
[],
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
let backgroundColor = theme.colors.background.default;
|
|
134
|
+
if (options?.surface) {
|
|
135
|
+
backgroundColor = theme.colors.background.surface;
|
|
136
|
+
}
|
|
137
|
+
|
|
103
138
|
useEffect(() => {
|
|
104
139
|
bottomSheetRef.current?.present();
|
|
105
140
|
return () => {
|
|
@@ -115,11 +150,6 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
115
150
|
/>
|
|
116
151
|
);
|
|
117
152
|
|
|
118
|
-
let backgroundColor = theme.colors.background.default;
|
|
119
|
-
if (options?.surface) {
|
|
120
|
-
backgroundColor = theme.colors.background.surface;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
153
|
return (
|
|
124
154
|
<SafeAreaView style={Styles.flex}>
|
|
125
155
|
<BottomSheetModal
|
|
@@ -132,9 +162,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
132
162
|
}}
|
|
133
163
|
handleComponent={null}
|
|
134
164
|
backdropComponent={backdropComponent}>
|
|
135
|
-
<View
|
|
136
|
-
style={{paddingBottom: bottom}}
|
|
137
|
-
accessibilityLabel={'BottomSheet'}>
|
|
165
|
+
<View onLayout={handleOnLayout} accessibilityLabel={'BottomSheet'}>
|
|
138
166
|
<View style={[styles.sheetContainer, {backgroundColor}]}>
|
|
139
167
|
<View style={styles.indicatorContainer}>
|
|
140
168
|
<View
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {NavigationProp} from '@react-navigation/native';
|
|
2
|
+
import {Alert} from 'react-native';
|
|
2
3
|
import {NavigationOptions, Theme} from './types';
|
|
3
4
|
import {HeaderRightAction} from './index';
|
|
4
5
|
import {getOptions} from './utils';
|
|
@@ -18,8 +19,9 @@ class Navigation {
|
|
|
18
19
|
const headerRight = params.headerRight?.();
|
|
19
20
|
const type = headerRight?.type;
|
|
20
21
|
if (type !== HeaderRightAction && type !== HeaderToolkitAction) {
|
|
21
|
-
|
|
22
|
-
'
|
|
22
|
+
Alert.alert(
|
|
23
|
+
'Rule',
|
|
24
|
+
'headerRight contains element type of HeaderRightAction | HeaderToolkitAction, Please check again.',
|
|
23
25
|
);
|
|
24
26
|
delete params.headerRight;
|
|
25
27
|
}
|
|
@@ -21,10 +21,12 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
|
|
|
21
21
|
theme,
|
|
22
22
|
options,
|
|
23
23
|
maxApi,
|
|
24
|
+
localization,
|
|
24
25
|
}) => {
|
|
25
26
|
const navigationRef = React.useRef<NavigationContainerRef>(null);
|
|
26
27
|
const navigator = useRef(new Navigator(navigationRef));
|
|
27
28
|
const [showGrid, setShowGrid] = useState(false);
|
|
29
|
+
const [language, setLanguage] = useState<'vi' | 'en'>('vi');
|
|
28
30
|
|
|
29
31
|
useEffect(() => {
|
|
30
32
|
const subscription = DeviceEventEmitter.addListener(
|
|
@@ -38,13 +40,32 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
|
|
|
38
40
|
};
|
|
39
41
|
}, []);
|
|
40
42
|
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
const listener = maxApi?.observer?.('language', (lang: 'vi' | 'en') => {
|
|
45
|
+
setLanguage(lang);
|
|
46
|
+
});
|
|
47
|
+
return () => {
|
|
48
|
+
listener?.();
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
41
52
|
navigator.current.maxApi = maxApi;
|
|
42
53
|
|
|
54
|
+
const translate = (key: string) => {
|
|
55
|
+
return localization?.[language]?.[key] || key;
|
|
56
|
+
};
|
|
57
|
+
|
|
43
58
|
return (
|
|
44
59
|
<SafeAreaProvider>
|
|
45
60
|
<BottomSheetModalProvider>
|
|
46
61
|
<ApplicationContext.Provider
|
|
47
|
-
value={{
|
|
62
|
+
value={{
|
|
63
|
+
theme,
|
|
64
|
+
navigator: navigator.current,
|
|
65
|
+
showGrid,
|
|
66
|
+
language,
|
|
67
|
+
translate,
|
|
68
|
+
}}>
|
|
48
69
|
<ReactNavigationContainer
|
|
49
70
|
theme={{
|
|
50
71
|
...theme,
|
package/Application/index.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import {NavigationContainer} from './NavigationContainer';
|
|
2
2
|
import Screen from '../Layout/Screen';
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
HeaderRightAction,
|
|
5
|
+
NavigationButton,
|
|
6
|
+
HeaderToolkitAction,
|
|
7
|
+
HeaderTitle,
|
|
8
|
+
} from './Components';
|
|
5
9
|
import BottomTab from './BottomTab';
|
|
6
10
|
import {createContext} from 'react';
|
|
7
11
|
import {defaultContext} from '../Consts';
|
|
@@ -14,5 +18,7 @@ export {
|
|
|
14
18
|
Screen,
|
|
15
19
|
NavigationButton,
|
|
16
20
|
HeaderRightAction,
|
|
21
|
+
HeaderToolkitAction,
|
|
22
|
+
HeaderTitle,
|
|
17
23
|
BottomTab,
|
|
18
24
|
};
|
package/Application/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {Animated
|
|
2
|
-
import React
|
|
1
|
+
import {Animated} from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import Navigator from './Navigator';
|
|
4
4
|
import {PopupNotifyProps} from '../Popup/types';
|
|
5
5
|
import Navigation from './Navigation';
|
|
@@ -65,6 +65,17 @@ export type Context = {
|
|
|
65
65
|
theme: Theme;
|
|
66
66
|
navigator?: Navigator;
|
|
67
67
|
showGrid?: boolean;
|
|
68
|
+
language: 'vi' | 'en';
|
|
69
|
+
translate: (key: string) => string;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export type LocalizationObject = {
|
|
73
|
+
vi: {
|
|
74
|
+
[key: string]: string;
|
|
75
|
+
};
|
|
76
|
+
en: {
|
|
77
|
+
[key: string]: string;
|
|
78
|
+
};
|
|
68
79
|
};
|
|
69
80
|
|
|
70
81
|
export type NavigationContainerProps = {
|
|
@@ -72,6 +83,7 @@ export type NavigationContainerProps = {
|
|
|
72
83
|
options?: NavigationOptions;
|
|
73
84
|
theme: Theme;
|
|
74
85
|
maxApi?: any;
|
|
86
|
+
localization?: LocalizationObject;
|
|
75
87
|
};
|
|
76
88
|
|
|
77
89
|
export type NavigationScreenProps = {
|
|
@@ -80,19 +92,6 @@ export type NavigationScreenProps = {
|
|
|
80
92
|
navigation: Navigation;
|
|
81
93
|
};
|
|
82
94
|
|
|
83
|
-
export interface ScreenProps extends ViewProps {
|
|
84
|
-
navigation?: Navigation;
|
|
85
|
-
enableKeyboardAvoidingView?: boolean;
|
|
86
|
-
headerBackground?: string;
|
|
87
|
-
scrollable?: boolean;
|
|
88
|
-
useAnimatedHeader?: boolean;
|
|
89
|
-
useExtendedHeader?: boolean;
|
|
90
|
-
scrollViewProps?: ScrollViewProps;
|
|
91
|
-
footerComponent?: ReactNode;
|
|
92
|
-
marginHeader?: number;
|
|
93
|
-
backgroundColor?: string;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
95
|
export type ScreenParams = {
|
|
97
96
|
[key: string]: any;
|
|
98
97
|
screen: Screen;
|
|
@@ -108,6 +107,7 @@ export interface ModalParams extends ScreenParams {
|
|
|
108
107
|
export interface BottomSheetParams extends ScreenParams {
|
|
109
108
|
[key: string]: any;
|
|
110
109
|
onDismiss?: () => void;
|
|
110
|
+
useSnap?: boolean;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
export type NavigationButtonProps = {
|
|
@@ -121,6 +121,7 @@ export type NavigationButtonProps = {
|
|
|
121
121
|
|
|
122
122
|
export type NavigationOptions = {
|
|
123
123
|
preventBack?: PopupNotifyProps;
|
|
124
|
+
onPressLeftHeader?: () => void;
|
|
124
125
|
surface?: boolean;
|
|
125
126
|
headerTransparent?: boolean;
|
|
126
127
|
hiddenBack?: boolean;
|
|
@@ -134,6 +135,7 @@ export type NavigationOptions = {
|
|
|
134
135
|
|
|
135
136
|
export interface HeaderBackProps extends NavigationButtonProps {
|
|
136
137
|
preventBack?: PopupNotifyProps;
|
|
138
|
+
onPressLeftHeader?: () => void;
|
|
137
139
|
accessibilityLabel?: string;
|
|
138
140
|
}
|
|
139
141
|
|
|
@@ -169,10 +171,12 @@ export type BottomTabItemProps = {
|
|
|
169
171
|
showDot?: boolean;
|
|
170
172
|
badgeLabel?: string;
|
|
171
173
|
screen: Screen;
|
|
174
|
+
options: NavigationOptions;
|
|
172
175
|
};
|
|
173
176
|
|
|
174
177
|
export type BottomTabProps = {
|
|
175
178
|
tabs: BottomTabItemProps[];
|
|
179
|
+
navigation: Navigation;
|
|
176
180
|
listeners?: {
|
|
177
181
|
tabPress?: any;
|
|
178
182
|
focus?: any;
|
package/Application/utils.tsx
CHANGED
|
@@ -76,6 +76,19 @@ const getOptions = (params: NavigationOptions, theme: Theme) => {
|
|
|
76
76
|
let titleProps = {};
|
|
77
77
|
let options = {};
|
|
78
78
|
|
|
79
|
+
if (typeof params.onPressLeftHeader === 'function') {
|
|
80
|
+
options = {
|
|
81
|
+
...options,
|
|
82
|
+
headerLeft: (props: any) => (
|
|
83
|
+
<HeaderLeft
|
|
84
|
+
{...props}
|
|
85
|
+
preventBack={params.preventBack}
|
|
86
|
+
onPressLeftHeader={params.onPressLeftHeader}
|
|
87
|
+
/>
|
|
88
|
+
),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
79
92
|
if (params.preventBack) {
|
|
80
93
|
options = {
|
|
81
94
|
...options,
|