-
Notifications
You must be signed in to change notification settings - Fork 0
/
navigation.js
37 lines (33 loc) · 1.19 KB
/
navigation.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
import React from 'react'
import { NavigationContainer } from '@react-navigation/native'
import {createStackNavigator } from '@react-navigation/stack'
import HomeScreen from './Screens/HomeScreen'
import NewPostScreen from './Screens/NewPostScreen'
import LoginScreen from './Screens/LoginScreen'
import SignupScreen from './Screens/SignupScreen'
const Stack = createStackNavigator()
const screenOptions = {
headerShown: false,
}
export const SignedInStack = () => (
<NavigationContainer>
<Stack.Navigator
initialRouteName='HomeScreen'
screenOptions={screenOptions}
>
<Stack.Screen name='HomeScreen' component={HomeScreen} />
<Stack.Screen name='NewPostScreen' component={NewPostScreen} />
</Stack.Navigator>
</NavigationContainer>
)
export const SignedOutStack = () => (
<NavigationContainer>
<Stack.Navigator
initialRouteName='LoginScreen'
screenOptions={screenOptions}
>
<Stack.Screen name='LoginScreen' component={LoginScreen} />
<Stack.Screen name='SignupScreen' component={SignupScreen} />
</Stack.Navigator>
</NavigationContainer>
)