Last active
June 15, 2018 21:30
-
-
Save JeffKGabriel/4ffaf0c525cf539711830fa670c94f89 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import React, { Component } from 'react'; | |
| import { View } from 'react-native'; | |
| import { connect } from 'react-redux' | |
| import { createSwitchNavigator, withNavigation } from 'react-navigation' | |
| import TabNavigator from './TabNavigator' | |
| import AuthStack from './AuthStack' | |
| import SplashScreen from '../components/SplashScreen' | |
| const RootNavigator = (props) =>{ | |
| let routeName = 'splash' | |
| if(!props.showSplash){ | |
| if(props.authed){ | |
| routeName = 'signedIn' | |
| }else{ | |
| routeName = 'signedOut' | |
| } | |
| } | |
| const ShowSignedIn = createSwitchNavigator( | |
| { | |
| signedIn : { | |
| screen : SplashScreen //TabNavigator | |
| }, | |
| signedOut : { | |
| screen : SplashScreen //AuthStack | |
| }, | |
| splash : { | |
| screen : SplashScreen | |
| }, | |
| }, | |
| { | |
| initialRouteName: routeName | |
| } | |
| ) | |
| console.log('ShowSignedIn',ShowSignedIn); | |
| //return <ShowSignedIn /> // element type invalid | |
| return ShowSignedIn | |
| } | |
| const mapStateToProps = state => ({ | |
| authed: state.Auth.authed, | |
| showSplash: state.Auth.showSplash | |
| }) | |
| export default connect(mapStateToProps)(RootNavigator) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment