-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathApp.tsx
60 lines (57 loc) · 2.42 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
import React, {useState, createContext} from 'react';
import {NavigationContainer, StackActions} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import {ApolloClient, InMemoryCache, ApolloProvider} from '@apollo/client';
import Splash from './components/Splash';
import StartingPage from './components/StartingPage';
import SeniorSignup from './components/SeniorSignup';
import SeniorDash from './components/SeniorDash';
import JuniorSignup from './components/JuniorSignup';
import JuniorDash from './components/JuniorDash';
import LoginPage from './components/LoginPage';
import NewTicket from './components/NewTicket';
import NewTicketDesc from './components/NewTicketDesc';
import Map from './components/MapView';
const client = new ApolloClient({
uri: 'http://localhost:3000/graphql',
cache: new InMemoryCache(),
});
const Stack = createStackNavigator();
// export const AuthContext = createContext({});
export default function App() {
// global state for whoever's ID
const [authID, setAuthID] = useState(null);
return (
<ApolloProvider client={client}>
<NavigationContainer>
{/* <AuthContext.Provider value={{authID, setAuthID}}> */}
<Stack.Navigator>
<Stack.Screen name="Splash" component={Splash} />
<Stack.Screen name="StartingPage" component={StartingPage} />
{/* <Stack.Screen name="SeniorSignup" component={SeniorSignup} /> */}
<Stack.Screen name="SeniorSignup">
{props => (
<SeniorSignup {...props} authID={authID} setAuthID={setAuthID} />
)}
</Stack.Screen>
<Stack.Screen name="SeniorDash" component={SeniorDash} />
<Stack.Screen name="JuniorSignup">
{props => (
<JuniorSignup {...props} authID={authID} setAuthID={setAuthID} />
)}
</Stack.Screen>
<Stack.Screen name="JuniorDash">
{props => (
<JuniorDash {...props} authID={authID} setAuthID={setAuthID} />
)}
</Stack.Screen>
<Stack.Screen name="LoginPage" component={LoginPage} />
<Stack.Screen name="NewTicket" component={NewTicket} />
<Stack.Screen name="NewTicketDesc" component={NewTicketDesc} />
<Stack.Screen name="Map" component={Map} />
</Stack.Navigator>
{/* </AuthContext.Provider> */}
</NavigationContainer>
</ApolloProvider>
);
}