Created
July 13, 2019 08:05
-
-
Save yottanami/4be8054fd0aa61775e44a63ec3cfbed7 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
import React, {Component} from 'react'; | |
import Categories from './src/Screens/Categories'; | |
import AuthLoadingScreen from './src/Screens/AuthLoadingScreen'; | |
import RequestOTP from './src/Screens/RequestOTP'; | |
import ConfirmOTP from './src/Screens/ConfirmOTP'; | |
import Posts from './src/Screens/Posts'; | |
import Post from './src/Screens/Post'; | |
import { createStackNavigator, createAppContainer, createSwitchNavigator, createDrawerNavigator } from "react-navigation"; | |
import { Icon } from "native-base"; | |
import { styles, colors } from "./src/Styles/styles"; | |
import NavigationService from './src/Configs/NavigationService'; | |
import Setting from './src/Configs/settings'; | |
const DrawerNav = createDrawerNavigator({ | |
Categories: Categories | |
}, | |
{ | |
drawerPosition: 'right' | |
}); | |
const AuthStack = createStackNavigator({ RequestOTP: RequestOTP, ConfirmOTP: ConfirmOTP }, | |
{ | |
headerStyle: { | |
backgroundColor: '#2f304c', | |
}, | |
defaultNavigationOptions: { | |
headerTitle: Setting.appName, | |
headerLeft: (<Icon ios='ios-menu' android="md-menu" style={styles.headerMenuIcon}/> | |
), | |
headerStyle: { | |
backgroundColor: colors.whiteBlue, | |
}, | |
headerTitleStyle: { | |
fontWeight: 'bold', | |
color: colors.grey, | |
flex: 1, | |
textAlign: 'right', | |
}, | |
} | |
}, | |
); | |
const MainNavigator = createStackNavigator({ | |
Home: Categories, | |
Posts: Posts, | |
Post: Post, | |
}, | |
{ | |
cardStyle: { backgroundColor: '#07263b' }, | |
initialRouteName: 'Home', | |
defaultNavigationOptions: { | |
headerTitle: Setting.appName, | |
headerLeft: (<Icon ios='ios-menu' android="md-menu" style={styles.headerMenuIcon} onPress={() => this.navigation.toggleDrawer()}/> | |
), | |
headerStyle: { | |
backgroundColor: colors.whiteBlue, | |
borderWidth: 1, | |
borderColor: colors.darkBlue | |
}, | |
headerTitleStyle: { | |
fontWeight: 'bold', | |
color: colors.grey, | |
flex: 1, | |
textAlign: 'right' | |
}, | |
} | |
} | |
); | |
export default createAppContainer(createSwitchNavigator( | |
{ | |
AuthLoading: AuthLoadingScreen, | |
App: DrawerNav, | |
AuthStack: AuthStack, | |
HomeDrawer: DrawerNav, | |
},{ | |
initialRouteName: 'AuthLoading', | |
} | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment