|
import { createSwitchNavigator, createStackNavigator } from 'react-navigation' |
|
import { StackNavigationOptions } from './Routes.NavigationOptions' |
|
import { getChildComponentNavigationOptions } from './Routes.Utils' |
|
import n from './Routes.Names' |
|
|
|
// Stacks |
|
import StartScreen from '../containers/Start' |
|
import GuestStack from './routes/Routes.Guest' |
|
import MainStack from './routes/Routes.MainStack' |
|
|
|
// Modals |
|
import ConfirmLicense from '../containers/user/modals/ConfirmLicense.Screen' |
|
import ConfirmEID from '../containers/user/modals/ConfirmEID.Screen' |
|
import RequiredLicense from '../containers/user/modals/RequiredLicense.Screen' |
|
|
|
export default createSwitchNavigator( |
|
{ |
|
[n.START]: StartScreen, |
|
[n.GUEST_STACK]: GuestStack, |
|
[n.USER_STACK]: createStackNavigator({ |
|
[n.USER_STACK]: MainStack, |
|
[n.LICENSE_ASKING_STACK]: createStackNavigator({ |
|
[n.REQUIRED_LICENSE]: { screen: RequiredLicense }, |
|
[n.CONFIRM_LICENSE]: { screen: ConfirmLicense }, |
|
[n.CONFIRM_EID]: { screen: ConfirmEID } |
|
}, { |
|
defaultNavigationOptions: StackNavigationOptions(), |
|
navigationOptions: ({ navigation }) => { |
|
return getChildComponentNavigationOptions(navigation) |
|
}, |
|
// IMPORTANT CONFIGURATIONS |
|
cardStyle: { |
|
backgroundColor: 'rgba(255,255,255,0.9)' |
|
}, |
|
transitionConfig: () => ({ |
|
containerStyle: { |
|
backgroundColor: 'transparent' |
|
} |
|
}) |
|
}) |
|
}, { |
|
mode: 'modal', |
|
headerMode: 'none', |
|
// IMPORTANT CONFIGURATIONS |
|
transparentCard: true, |
|
navigationOptions: StackNavigationOptions() |
|
}), |
|
}, |
|
{ |
|
headerMode: 'none', |
|
navigationOptions: StackNavigationOptions() |
|
} |
|
) |