-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
205 lines (197 loc) · 5.08 KB
/
App.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
import React, { Component } from "react";
import { StyleSheet } from "react-native";
import { createMaterialBottomTabNavigator } from "@react-navigation/material-bottom-tabs";
import { NavigationContainer } from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";
import FlyBox from "./containers/FlyBox";
import AddFly from "./containers/AddFly";
import EditFly from "./containers/EditFly";
import FishCaught from "./containers/FishCaught";
import AddFish from "./containers/AddFish";
import EditFish from "./containers/EditFish";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import { Provider } from "react-redux";
import { createStore } from "redux";
import { composeWithDevTools } from "redux-devtools-extension";
import rootReducer from "./reducers";
import PhotoSelector from "./components/PhotoSelector";
const Tab = createMaterialBottomTabNavigator();
const FlyBoxStack = createStackNavigator();
const AddFlyStack = createStackNavigator();
const FishStack = createStackNavigator();
const store = createStore(rootReducer, composeWithDevTools());
function MyTabs() {
return (
<Tab.Navigator
initialRouteName="MyFlyBox"
activeColor={"#f7841f"}
barStyle={{ backgroundColor: "#212326" }}
>
<Tab.Screen
name="MyFlyBox"
component={FlyBoxContainer}
options={{
tabBarLabel: "My Fly Box",
tabBarIcon: ({ color }) => (
<MaterialCommunityIcons name="hook" color={color} size={25} />
),
}}
/>
<Tab.Screen
name="AddFly"
component={AddFlyContainer}
options={{
tabBarLabel: "Add Fly",
tabBarIcon: ({ color }) => (
<MaterialCommunityIcons name="plus" color={color} size={25} />
),
}}
/>
<Tab.Screen
name="FishCaught"
component={FishContainer}
options={{
tabBarLabel: "Fish Caught",
tabBarIcon: ({ color }) => (
<MaterialCommunityIcons name="fish" color={color} size={25} />
),
}}
/>
</Tab.Navigator>
);
}
function FlyBoxContainer() {
return (
<FlyBoxStack.Navigator>
<FlyBoxStack.Screen
name="MyFlyBox"
component={FlyBox}
options={{
title: "My Fly Box",
headerStyle: {
backgroundColor: "#212326",
},
headerTintColor: "#ffffff",
headerTitleStyle: {
fontWeight: "bold",
},
}}
/>
<FlyBoxStack.Screen
name="EditFly"
component={EditFly}
options={{
title: "Edit Fly",
headerStyle: {
backgroundColor: "#212326",
},
headerTintColor: "#ffffff",
headerTitleStyle: {
fontWeight: "bold",
},
}}
/>
</FlyBoxStack.Navigator>
);
}
function AddFlyContainer() {
return (
<AddFlyStack.Navigator>
<AddFlyStack.Screen
name="AddFly"
component={AddFly}
options={{
title: "Add New Fly",
headerStyle: {
backgroundColor: "#212326",
},
headerTintColor: "#ffffff",
headerTitleStyle: {
fontWeight: "bold",
},
}}
/>
</AddFlyStack.Navigator>
);
}
function FishContainer() {
return (
<FishStack.Navigator>
<FishStack.Screen
name="FishCaught"
component={FishCaught}
options={{
title: "Fish Caught",
headerStyle: {
backgroundColor: "#212326",
},
headerTintColor: "#ffffff",
headerTitleStyle: {
fontWeight: "bold",
},
}}
/>
<FishStack.Screen
name="EditFish"
component={EditFish}
options={{
title: "Edit Fish",
headerStyle: {
backgroundColor: "#212326",
},
headerTintColor: "#ffffff",
headerTitleStyle: {
fontWeight: "bold",
},
}}
/>
<FishStack.Screen
name="AddFish"
component={AddFish}
options={{
title: "Add Fish",
headerStyle: {
backgroundColor: "#212326",
},
headerTintColor: "#ffffff",
headerTitleStyle: {
fontWeight: "bold",
},
}}
/>
<FishStack.Screen
name="PhotoSelector"
component={PhotoSelector}
options={{
title: "Upload or take a photo of your catch!",
headerStyle: {
backgroundColor: "#212326",
},
headerTintColor: "#ffffff",
headerTitleStyle: {
fontWeight: "bold",
},
}}
/>
</FishStack.Navigator>
);
}
class App extends Component {
render() {
return (
<Provider store={store}>
<NavigationContainer>
<MyTabs />
</NavigationContainer>
</Provider>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: "center",
justifyContent: "center",
},
});
export default App;