-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
81 lines (66 loc) · 2.46 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
/*
Notes for running:
- Expo CLI start metro bundler (HTTP server that compiles javascript using Babel and serves it to Expo app)
npx expo start (OR npm start)
- Exit
Ctrl+C
npm install -g [email protected] to UPDATE
*/
import React, { useState, useEffect } from "react";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import registerNNPushToken from "native-notify";
import { StyleSheet } from "react-native";
import Login from "./src/Screens/Login";
import Home from "./src/Screens/Home";
import GroupDetails from "./src/Screens/GroupDetails";
import ExerciseDetails from "./src/Screens/ExerciseDetails";
import Profile from "./src/Screens/Profile";
const Stack = createNativeStackNavigator();
export default function App() {
// push notifications
registerNNPushToken(5368, "6UNQ6ckAm0sCcbBRw3DUDj");
// globalstate managmenet
const [email, setEmail] = useState("");
const [groups, setGroups] = useState([]);
const [chosenGroup, setChosenGroup] = useState("");
const [exercises, setExercises] = useState([]);
const [chosenExercise, setChosenExercise] = useState("");
const [clusters, setClusters] = useState([]);
const GlobalState = {
email,
setEmail,
groups,
setGroups,
chosenGroup,
setChosenGroup,
exercises,
setExercises,
chosenExercise,
setChosenExercise,
clusters,
setClusters,
};
// navigation
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Login" options={{ headerShown: false }}>
{(props) => <Login {...props} GlobalState={GlobalState} />}
</Stack.Screen>
<Stack.Screen name="Home" options={{ headerShown: false }}>
{(props) => <Home {...props} GlobalState={GlobalState} />}
</Stack.Screen>
<Stack.Screen name="GroupDetails" options={{ headerShown: false }}>
{(props) => <GroupDetails {...props} GlobalState={GlobalState} />}
</Stack.Screen>
<Stack.Screen name="ExerciseDetails" options={{ headerShown: false }}>
{(props) => <ExerciseDetails {...props} GlobalState={GlobalState} />}
</Stack.Screen>
<Stack.Screen name="Profile" options={{ headerShown: false }}>
{(props) => <Profile {...props} GlobalState={GlobalState} />}
</Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
);
}