-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
59 lines (53 loc) · 1.43 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
import React from 'react';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import {Splash} from './screens/Splash';
import {routes, screenOptions} from './constants';
import {SignInScreen} from './screens/SignIn';
import HomeScreen from './screens/Home';
import CredentialsProvider from './hooks/useAuth';
import Navigator from './Navigator';
import Details from './screens/Details';
const Stack = createNativeStackNavigator();
function App(): React.JSX.Element {
return (
<CredentialsProvider>
<Navigator
loading={
<Stack.Screen
name={routes.splash}
options={{headerShown: false}}
component={Splash}
/>
}
signedOut={
<Stack.Screen
name={routes.signIn}
component={SignInScreen}
options={{
...screenOptions,
title: 'Sign in',
}}
/>
}
signedIn={
<>
<Stack.Screen
name={routes.home}
component={HomeScreen}
options={{
...screenOptions,
title: 'Notifications',
}}
/>
<Stack.Screen
name={routes.details}
component={Details}
options={{...screenOptions}}
/>
</>
}
/>
</CredentialsProvider>
);
}
export default App;