-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.js
217 lines (213 loc) · 7.04 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
206
207
208
209
210
211
212
213
214
215
216
217
/*
This page manages the header navigation and page navigations.
Authors: Alysha Chan, Shane Zhu, Ibukun Adeloye, Isabella DeBoer
*/
import React from "react";
import { NavigationContainer, useNavigation } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { StyleSheet, View, TouchableOpacity } from "react-native";
import { FontAwesome } from "@expo/vector-icons";
import ToDoList from "./src/screens/todo";
import Friends from "./src/screens/friends";
import NewTaskScreen from "./src/screens/newtask";
import Camera from "./src/screens/camera";
import ConfirmPhoto from "./src/screens/confirmphoto";
import UploadPhoto from "./src/screens/uploadphoto";
import WelcomePage from "./src/screens/welcome";
import WelcomeView from "./.vscode/Views/welcomeView";
import SignInUpView from "./.vscode/Views/SigninView";
import CreateAccountView from "./.vscode/Views/createAccountView";
import { useFonts } from "expo-font";
const Stack = createNativeStackNavigator();
export default function App() {
/* Use custom font */
const [fontsLoaded] = useFonts({
"GreatVibes-Regular": require("./assets/GreatVibes-Regular.ttf"),
});
return (
<NavigationContainer>
{/* welcome.js navigation */}
<Stack.Navigator initialRouteName="WelcomeView">
<Stack.Screen
name="WelcomePage"
component={WelcomePage}
options={{ headerShown: false }}
/>
{/* friends.tsx naviation */}
<Stack.Screen
name="Friends"
component={Friends}
options={({ navigation }) => ({
title: "FRIENDS",
/* Header color to blue, bold font */
headerStyle: {
backgroundColor: "#749BBF",
},
headerTitleStyle: {
fontWeight: "bold",
},
/* Friends, ToDoList, NewTask top navigation */
headerRight: () => (
<View style={styles.Xstack}>
<TouchableOpacity
onPress={() => navigation.navigate("Friends")}
>
<FontAwesome name="user" size={20} color="black" />
</TouchableOpacity>
<TouchableOpacity
onPress={() => navigation.navigate("ToDoList")}
>
<FontAwesome
name="bars"
size={20}
color="black"
marginLeft={20}
/>
</TouchableOpacity>
<TouchableOpacity
onPress={() => navigation.navigate("NewTaskScreen")}
>
<FontAwesome
name="plus"
size={20}
color="black"
marginLeft={20}
/>
</TouchableOpacity>
</View>
),
})}
/>
{/* todo.js naviation */}
<Stack.Screen
name="ToDoList"
component={ToDoList}
options={({ navigation }) => ({
title: "TO-DO'S",
/* Header color to blue, bold font */
headerStyle: {
backgroundColor: "#749BBF",
},
headerTitleStyle: {
fontWeight: "bold",
},
/* Friends, ToDoList, NewTask top navigation */
headerRight: () => (
<View style={styles.Xstack}>
<TouchableOpacity
onPress={() => navigation.navigate("Friends")}
>
<FontAwesome name="user" size={20} color="black" />
</TouchableOpacity>
<TouchableOpacity
onPress={() => navigation.navigate("ToDoList")}
>
<FontAwesome
name="bars"
size={20}
color="black"
marginLeft={20}
/>
</TouchableOpacity>
<TouchableOpacity
onPress={() => navigation.navigate("NewTaskScreen")}
>
<FontAwesome
name="plus"
size={20}
color="black"
marginLeft={20}
/>
</TouchableOpacity>
</View>
),
})}
/>
{/* newtask.js naviation */}
<Stack.Screen
name="NewTaskScreen"
component={NewTaskScreen}
options={({ navigation }) => ({
title: "ADD TASK",
/* Header color to blue, bold font */
headerStyle: {
backgroundColor: "#749BBF",
},
headerTitleStyle: {
fontWeight: "bold",
},
/* Friends, ToDoList, NewTask top navigation */
headerRight: () => (
<View style={styles.Xstack}>
<TouchableOpacity
onPress={() => navigation.navigate("Friends")}
>
<FontAwesome name="user" size={20} color="black" />
</TouchableOpacity>
<TouchableOpacity
onPress={() => navigation.navigate("ToDoList")}
>
<FontAwesome
name="bars"
size={20}
color="black"
marginLeft={20}
/>
</TouchableOpacity>
<TouchableOpacity
onPress={() => navigation.navigate("NewTaskScreen")}
>
<FontAwesome
name="plus"
size={20}
color="black"
marginLeft={20}
/>
</TouchableOpacity>
</View>
),
})}
/>
{/* camera.tsx naviation */}
<Stack.Screen name="Camera" component={Camera} />
{/* confirmphoto.tsx naviation */}
<Stack.Screen
name="ConfirmPhoto"
component={ConfirmPhoto}
options={{ headerShown: false }}
/>
{/* uploadphoto.tsx naviation */}
<Stack.Screen
name="UploadPhoto"
component={UploadPhoto}
options={{ headerShown: false }}
/>
{/* welcomeView.js naviation */}
<Stack.Screen
name="WelcomeView"
component={WelcomeView}
options={{ headerShown: false }}
/>
{/* SigninView.js naviation */}
<Stack.Screen
name="SignInUpView"
component={SignInUpView}
options={{ headerShown: false }}
/>
{/* createAccountView.js naviation */}
<Stack.Screen
name="CreateAccountView"
component={CreateAccountView}
options={{ headerShown: false }}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
/* Styles for imported elements*/
const styles = StyleSheet.create({
Xstack: {
flexDirection: "row",
alignItems: "center",
},
});