-
Notifications
You must be signed in to change notification settings - Fork 3
/
routes.js
145 lines (137 loc) · 2.82 KB
/
routes.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import React from 'react';
import { Platform } from 'react-native';
import { StackNavigator, TabNavigator, DrawerNavigator } from 'react-navigation';
import Icon from 'react-native-vector-icons/Ionicons';
import Screen1 from '../screens/Screen1';
import Screen2 from '../screens/Screen2';
import Screen3 from '../screens/Screen3';
import Screen4 from '../screens/Screen4';
import Screen5 from '../screens/Screen5';
import Screen6 from '../screens/Screen6';
import Screen7 from '../screens/Screen7';
import Screen8 from '../screens/Screen8';
import Screen9 from '../screens/Screen9';
import Screen10 from '../screens/Screen10';
const DrawerIcon = ({ navigate }) => {
if (Platform.OS === 'ios') {
return null;
}
return (
<Icon
name="md-menu"
size={28}
color="black"
onPress={() => navigate('DrawerOpen')}
style={{ paddingLeft: 20 }}
/>
);
}
export const Stack1 = StackNavigator({
Screen1: {
screen: Screen1,
navigationOptions: {
header: (props) => ({
left: <DrawerIcon {...props} />,
}),
},
},
Screen2: {
screen: Screen2,
},
Screen3: {
screen: Screen3,
},
});
export const Stack2 = StackNavigator({
Screen4: {
screen: Screen4,
navigationOptions: {
header: (props) => ({
left: <DrawerIcon {...props} />,
}),
},
},
Screen5: {
screen: Screen5,
},
Screen6: {
screen: Screen6,
},
Screen7: {
screen: Screen7,
},
});
export const Stack3 = StackNavigator({
Screen8: {
screen: Screen8,
navigationOptions: {
header: (props) => ({
left: <DrawerIcon {...props} />,
}),
},
},
Screen9: {
screen: Screen9,
},
Screen10: {
screen: Screen10,
},
});
export const Tabs = TabNavigator({
Home: {
screen: Stack1,
navigationOptions: {
tabBar: {
label: 'Home',
icon: ({ tintColor }) =>
<Icon name="ios-albums-outline" size={32} color={tintColor} />,
},
},
},
Camera: {
screen: Stack2,
navigationOptions: {
tabBar: {
label: 'Camera',
icon: ({ tintColor }) =>
<Icon name="ios-aperture-outline" size={32} color={tintColor} />,
},
},
},
Analytics: {
screen: Stack3,
navigationOptions: {
tabBar: {
label: 'Analytics',
icon: ({ tintColor }) =>
<Icon name="ios-analytics-outline" size={32} color={tintColor} />,
},
},
},
});
export const Drawer = DrawerNavigator({
Home: {
screen: Stack1,
navigationOptions: {
drawer: {
label: 'Home',
},
},
},
Camera: {
screen: Stack2,
navigationOptions: {
drawer: {
label: 'Camera',
},
},
},
Analytics: {
screen: Stack3,
navigationOptions: {
drawer: {
label: 'Analytics',
},
},
},
});