-
Notifications
You must be signed in to change notification settings - Fork 0
/
Router.js
176 lines (167 loc) · 4.19 KB
/
Router.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
import React from 'react'
import { StyleSheet } from 'react-native'
import {
StackNavigator,
TabNavigator,
} from 'react-navigation'
import { Icon } from 'react-native-elements'
import {
blue1,
} from './styles/shared'
import ListsScreenConnected from './containers/ListsScreenConnected'
import ListScreenConnected from './containers/ListScreenConnected'
import TaskScreen from './containers/TaskScreen'
import MeScreenConnected from './containers/MeScreenConnected'
import RegisterScreenConnected from './containers/RegisterScreenConnected'
import SearchScreen from './components/SearchScreen'
import SignInScreenConnected from './containers/SignInScreenConnected'
import SplashScreenConnected from './containers/SplashScreenConnected'
import BackButton from './components/BackButton'
import NavbarAddButton from './components/NavbarAddButton'
import NewListScreenConnected from './containers/NewListScreenConnected'
import NewTaskScreenConnected from './containers/NewTaskScreenConnected'
import CameraScreen from './components/CameraScreen'
import SavingPhotoModal from './containers/SavingPhotoModal'
import EditListButton from './components/EditListButton'
import RenameListScreen from './containers/RenameListScreen'
import ListNavbarTitle from './containers/ListNavbarTitle'
const AuthRouter = TabNavigator({
Register: {
screen: RegisterScreenConnected,
navigationOptions: {
tabBarIcon: ({ tintColor }) => <Icon name="user-plus" type="font-awesome" color={tintColor} />,
},
},
SignIn: {
screen: SignInScreenConnected,
navigationOptions: {
tabBarIcon: ({ tintColor }) => <Icon name="sign-in" type="font-awesome" color={tintColor} />,
tabBarLabel: 'Sign In',
},
},
}, {
animationEnabled: true,
initialRouteName: 'SignIn',
tabBarOptions: {
activeTintColor: blue1,
style: {
backgroundColor: 'white',
},
},
})
const ListsRouter = StackNavigator({
ListOfLists: {
screen: ListsScreenConnected,
navigationOptions: ({ navigation }) => ({
title: 'Lists',
}),
},
List: {
screen: ListScreenConnected,
navigationOptions: ({ navigation }) => ({
title: <ListNavbarTitle navigation={navigation} />,
headerLeft: <BackButton navigation={navigation} />,
headerRight: <EditListButton navigation={navigation} />,
}),
},
Task: {
screen: TaskScreen,
navigationOptions: ({ navigation }) => ({
headerLeft: <BackButton navigation={navigation} />,
}),
},
}, {
navigationOptions: {
headerStyle: {
backgroundColor: 'white',
},
},
})
const DashboardRouter = TabNavigator({
Search: {
screen: SearchScreen,
navigationOptions: {
tabBarIcon: ({ tintColor }) => <Icon name="search" color={tintColor} />,
},
},
Lists: {
screen: ListsRouter,
navigationOptions: {
tabBarIcon: ({ tintColor }) => <Icon name="list" color={tintColor} />,
title: 'Lists',
},
},
Me: {
screen: MeScreenConnected,
navigationOptions: {
tabBarIcon: ({ tintColor }) => <Icon name="perm-identity" color={tintColor} />,
},
},
}, {
initialRouteName: 'Lists',
tabBarOptions: {
activeTintColor: blue1,
style: {
backgroundColor: 'white',
},
},
})
const ApplicationRouter = StackNavigator({
Splash: {
screen: SplashScreenConnected,
},
Auth: {
screen: AuthRouter,
navigationOptions: {
gesturesEnabled: false,
},
},
Dashboard: {
screen: DashboardRouter,
navigationOptions: {
gesturesEnabled: false,
},
},
}, {
headerMode: 'none',
})
const CameraRouter = StackNavigator({
Camera: {
screen: CameraScreen,
},
SavingPhotoModal: {
screen: SavingPhotoModal,
navigationOptions: {
gesturesEnabled: false,
},
},
}, {
headerMode: 'none',
mode: 'modal',
})
const Router = StackNavigator({
Application: {
screen: ApplicationRouter,
},
NewList: {
screen: NewListScreenConnected,
},
NewTask: {
screen: NewTaskScreenConnected,
},
RenameList: {
screen: RenameListScreen,
},
TakeNewPhotoModal: {
screen: CameraRouter,
}
}, {
headerMode: 'none',
mode: 'modal',
})
const styles = StyleSheet.create({
backButton: {
marginLeft: 10,
},
})
export default Router