-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.tsx
80 lines (72 loc) · 3.1 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
import React, { Context } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import Landing from './src/pages/Landing';
import Main from './src/pages/Main';
import Settings from './src/pages/Settings';
import SignIn from './src/pages/SignIn';
import InitialSettings from './src/pages/InitialSettings';
import Error from './src/pages/Error';
import { StatusBar } from 'react-native';
import { NativeWindStyleSheet } from 'nativewind';
NativeWindStyleSheet.setOutput({
web: 'native',
});
const Stack = createNativeStackNavigator();
export const IdTokenContext: Context<
[string | null, (value: string | null) => void]
> = React.createContext([null, () => {}] as any);
export default function App(): JSX.Element {
const [idToken, setIdToken] = React.useState<string | null>(null);
return (
<GestureHandlerRootView className="flex-1 h-full">
{/* The backgroundColor is currently a non-working hack for the web version. */}
<StatusBar
barStyle="light-content"
translucent={true}
backgroundColor="#09090b"
/>
<IdTokenContext.Provider value={[idToken, setIdToken]}>
<NavigationContainer>
<Stack.Navigator
screenOptions={{
headerShown: false,
orientation: 'portrait',
}}>
<Stack.Screen
name="TableJet - Landing"
component={Landing}
options={{ title: 'Landing' }}
/>
<Stack.Screen
name="TableJet - Error"
component={Error}
options={{ title: 'Error' }}
/>
<Stack.Screen
name="TableJet - Sign In"
component={SignIn}
options={{ title: 'SignIn' }}
/>
<Stack.Screen name="TableJet" component={Main} />
<Stack.Screen
name="TableJet - Initial Settings"
component={InitialSettings as any}
initialParams={{ page: 'NOTIFS' }}
/>
<Stack.Screen
name="TableJet - Settings"
component={Settings}
options={{
headerShown: true,
headerTransparent: true,
headerTintColor: 'white',
}}
/>
</Stack.Navigator>
</NavigationContainer>
</IdTokenContext.Provider>
</GestureHandlerRootView>
);
}