forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgetRootNavigatorScreenOptions.js
60 lines (52 loc) · 2.27 KB
/
getRootNavigatorScreenOptions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import modalCardStyleInterpolator from './modalCardStyleInterpolator';
import styles from '../../../styles/styles';
import variables from '../../../styles/variables';
import getNavigationModalCardStyle from '../../../styles/getNavigationModalCardStyles';
import CONFIG from '../../../CONFIG';
import getRightModalNavigatorOptions from './getRightModalNavigatorOptions';
const commonScreenOptions = {
headerShown: false,
gestureDirection: 'horizontal',
animationEnabled: true,
cardOverlayEnabled: true,
animationTypeForReplace: 'push',
};
export default (isSmallScreenWidth) => ({
rightModalNavigator: {
...commonScreenOptions,
...getRightModalNavigatorOptions(isSmallScreenWidth),
},
homeScreen: {
title: CONFIG.SITE_TITLE,
...commonScreenOptions,
// Note: The card* properties won't be applied on mobile platforms, as they use the native defaults.
cardStyleInterpolator: (props) => modalCardStyleInterpolator(isSmallScreenWidth, false, props),
cardStyle: {
...getNavigationModalCardStyle(),
width: isSmallScreenWidth ? '100%' : variables.sideBarWidth,
// We need to translate the sidebar to not be covered by the StackNavigator so it can be clickable.
transform: [{translateX: isSmallScreenWidth ? 0 : -variables.sideBarWidth}],
...(isSmallScreenWidth ? {} : styles.borderRight),
},
},
// eslint-disable-next-line rulesdir/no-negated-variables
fullScreen: {
...commonScreenOptions,
cardStyleInterpolator: (props) => modalCardStyleInterpolator(isSmallScreenWidth, true, props),
cardStyle: {
...getNavigationModalCardStyle(),
// This is necessary to cover whole screen. Including translated sidebar.
marginLeft: isSmallScreenWidth ? 0 : -variables.sideBarWidth,
},
},
centralPaneNavigator: {
title: CONFIG.SITE_TITLE,
...commonScreenOptions,
animationEnabled: isSmallScreenWidth,
cardStyleInterpolator: (props) => modalCardStyleInterpolator(isSmallScreenWidth, true, props),
cardStyle: {
...getNavigationModalCardStyle(),
paddingRight: isSmallScreenWidth ? 0 : variables.sideBarWidth,
},
},
});