-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathNavigator.js
106 lines (98 loc) · 3.16 KB
/
Navigator.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import { createAppContainer } from 'react-navigation';
import { createBottomTabNavigator } from 'react-navigation-tabs';
import { createStackNavigator } from 'react-navigation-stack';
import { Easing, Animated } from 'react-native';
import Home from './layouts/Home'
import Cards from './layouts/Cards'
import Favorites from './layouts/Favorites'
import Settings from './layouts/Settings'
import Profile from './layouts/Profile'
import New from './layouts/New'
import Announcer from './layouts/Announcer'
import Account from './layouts/Account'
import Language from './layouts/Language'
import Voice from './layouts/Voice'
import Notification from './layouts/Notification'
import Browser from './layouts/Browser'
import Remove from './layouts/Remove'
import Packs from './layouts/Packs'
import Avatar from './layouts/Avatar'
import Subscription from './layouts/Subscription'
import Premium from './layouts/Premium'
import Legal from './layouts/Legal'
import Accessibility from './layouts/Accessibility'
import Apps from './layouts/Apps'
const AppNavigator = createStackNavigator({
Home: { screen: Home },
Cards: { screen: Cards },
Favorites: { screen: Favorites },
Settings: { screen: Settings },
Profile: { screen: Profile },
New: { screen: New },
Account: { screen: Account },
Browser: { screen: Browser },
Language: { screen: Language },
Voice: { screen: Voice },
Notification: { screen: Notification },
Remove: { screen: Remove },
Packs: { screen: Packs },
Avatar: { screen: Avatar },
Subscription: { screen: Subscription },
Premium: { screen: Premium },
Legal: { screen: Legal },
Accessibility:{ screen: Accessibility },
Apps: { screen: Apps },
},
{
headerMode: 'none',
navigationOptions: {
headerVisible: false,
}
}
);
function forVertical(props) {
const { layout, position, scene } = props;
const index = scene.index;
const height = layout.initHeight;
const translateX = 0;
const translateY = position.interpolate({
inputRange: ([index - 1, index, index + 1]: Array<number>),
outputRange: ([height, 0, 0]: Array<number>)
});
const opacity = position.interpolate({
inputRange: ([index - 1, index, index + 1]: Array<number>),
outputRange: [0, 1, 0]
});
return {
transform: [{ translateX }, { translateX }],
opacity
};
}
const RootNavigator = createAppContainer(AppNavigator);
const ModelNavigator = createStackNavigator({
Root: { screen: RootNavigator },
Announcer: {screen: Announcer }
},
{
mode: 'modal',
headerMode: 'none',
defaultNavigationOptions: {
headerVisible: false,
gesturesEnabled: false,
},
cardStyle: {
backgroundColor: 'transparent',
opacity: 1,
},
transparentCard: true,
transitionConfig: () => ({
transitionSpec: {
duration: 0,
},
containerStyle: {
backgroundColor: 'transparent',
}
})
}
);
export default createAppContainer(ModelNavigator);