-
Notifications
You must be signed in to change notification settings - Fork 0
/
Nav.js
30 lines (26 loc) · 802 Bytes
/
Nav.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
import { createSwitchNavigator, createStackNavigator } from 'react-navigation';
import Login from './screens/Login';
import SkateSessions from './screens/SkateSessions';
import SplashScreen from './screens/SplashScreen';
import ViewSession from './screens/ViewSession';
const LoginStack = createStackNavigator({
Login: { screen: Login },
Sessions: { screen: SkateSessions },
Session: { screen: ViewSession }
});
const AuthorisedStack = createStackNavigator({
Sessions: { screen: SkateSessions },
Session: { screen: ViewSession },
Login: { screen: Login } // Used if the user logs out
});
const App = createSwitchNavigator(
{
SplashScreen: SplashScreen,
Login: LoginStack,
Auth: AuthorisedStack,
},
{
initialRouteName: 'SplashScreen',
}
);
export default App;