Created
September 11, 2017 18:18
-
-
Save diego3g/3378c3c17bbcd20982c2793e2c52eb9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/routes.js | |
import { StackNavigator } from 'react-navigation'; | |
import Login from './pages/login'; | |
import Logged from './pages/logged'; | |
export const SignedOutRoutes = StackNavigator({ | |
Login: { | |
screen: Login, | |
navigationOptions: { | |
title: "Entrar" | |
} | |
}, | |
}); | |
export const SignedInRoutes = StackNavigator({ | |
Logged: { | |
screen: Logged, | |
navigationOptions: { | |
title: "Meu perfil" | |
} | |
}, | |
}); | |
export const createRootNavigator = (signedIn = false) => { | |
return StackNavigator({ | |
SignedIn: { screen: SignedInRoutes }, | |
SignedOut: { screen: SignedOutRoutes } | |
}, | |
{ | |
headerMode: "none", | |
mode: "modal", | |
initialRouteName: signedIn ? "SignedIn" : "SignedOut", | |
navigationOptions: { | |
gesturesEnabled: false | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment