-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
91 lines (84 loc) · 2.7 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
85
86
87
88
89
90
91
import React from 'react';
import {SafeAreaView, StyleSheet, useColorScheme} from 'react-native';
import {NavigationContainer, DefaultTheme} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import IntroPage from './pages/IntroPage';
import EmailPage from './pages/EmailPage';
import ConfirmEmailPage from './pages/ConfirmEmailPage';
import PhoneNumberEntryPage from './pages/PhoneNumberEntryPage';
import ConfirmationCodePage from './pages/ConfirmationCodePage';
import SetupConfirmationPage from './pages/SetupConfirmationPage';
import NotificationPermissionPage from './pages/NotificationPermissionPage';
const Stack = createNativeStackNavigator();
const NavigationTheme = (colorScheme: string) => {
return {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
background: colorScheme === 'light' ? '#FFFFFF' : '#000000',
},
};
};
function App(): JSX.Element {
const colorScheme = useColorScheme() || 'light';
return (
<SafeAreaView style={styles.container}>
<NavigationContainer theme={NavigationTheme(colorScheme)}>
<Stack.Navigator screenOptions={{headerShown: true}}>
<Stack.Screen
options={nonNavigable}
name="IntroPage"
component={IntroPage}
/>
<Stack.Screen
name="EmailPage"
options={navigable(colorScheme)}
component={EmailPage}
/>
<Stack.Screen
name="ConfirmEmailPage"
options={navigable(colorScheme)}
component={ConfirmEmailPage}
/>
<Stack.Screen
name="PhoneNumberEntryPage"
options={navigable(colorScheme)}
component={PhoneNumberEntryPage}
/>
<Stack.Screen
name="ConfirmationCodePage"
options={navigable(colorScheme)}
component={ConfirmationCodePage}
/>
<Stack.Screen
name="SetupConfirmationPage"
options={nonNavigable}
component={SetupConfirmationPage}
/>
<Stack.Screen
name="NotificationPermissionPage"
options={navigable(colorScheme)}
component={NotificationPermissionPage}
/>
</Stack.Navigator>
</NavigationContainer>
</SafeAreaView>
);
}
const nonNavigable = {headerShown: false};
const navigable = (colorScheme: string) => {
return {
title: '',
headerTintColor: colorScheme === 'light' ? '#000000' : '#FFFFFF',
headerStyle: {
backgroundColor: 'transparent',
},
headerShadowVisible: false,
};
};
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
export default App;