-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
84 lines (79 loc) · 2.73 KB
/
App.tsx
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
/// <reference path="app/globals.d.ts" />
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import React from "react";
import HomeScreen from "./app/screens/HomeScreen";
import LoginScreen from "./app/screens/LoginScreen";
import RegistrationScreen from "./app/screens/RegistrationScreen";
import StudentHome from "./app/screens/homepages/StudentHome";
import TeacherHome from "./app/screens/homepages/TeacherHome";
import AdminHome from "./app/screens/homepages/AdminHome";
import StudentCourse from "./app/screens/coursepages/StudentCourse";
import TeacherCourse from "./app/screens/coursepages/TeacherCourse";
import AdminCourse from "./app/screens/coursepages/AdminCourse";
import Settings from "./app/screens/Settings";
import { RootStackParamList } from "./app/components/types";
const Stack = createNativeStackNavigator<RootStackParamList>();
const setStackOptions = (title: string) => {
return {
// options to be passed to the navigator
headerStyle: {
backgroundColor: "#1e88e5",
},
headerTintColor: "#fff",
headerTitleStyle: {
fontWeight: "bold",
fontSize: 18,
},
headerTitle: title,
headerTitleAlign: "center",
headerLeft: () => null
};
}
export default function App() {
return (
<NavigationContainer>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen name="SHome" component={StudentHome} options={setStackOptions("Home")}/>
<Stack.Screen name="THome" component={TeacherHome} options={setStackOptions("Home")}/>
<Stack.Screen name="AHome" component={AdminHome} options={setStackOptions("Home")}/>
<Stack.Screen
name="Home"
component={HomeScreen}
options={setStackOptions("Attendance Application")}
/>
{/* Change title of this later */}
<Stack.Screen
name="SCourse"
component={StudentCourse}
options={setStackOptions("Course")}
/>
<Stack.Screen
name="TCourse"
component={TeacherCourse}
options={setStackOptions("Course")}
/>
<Stack.Screen
name="ACourse"
component={AdminCourse}
options={setStackOptions("Course")}
/>
<Stack.Screen
name="Login"
component={LoginScreen}
options={setStackOptions("Login")}
/>
<Stack.Screen
name="Register"
component={RegistrationScreen}
options={setStackOptions("Register")}
/>
<Stack.Screen
name="Settings"
component={Settings}
options={setStackOptions("Settings")}
/>
</Stack.Navigator>
</NavigationContainer>
);
}