ecency-mobile/src/config/routes.js

65 lines
1.4 KiB
JavaScript
Raw Normal View History

import { DrawerNavigator, SwitchNavigator, createStackNavigator } from 'react-navigation';
import { BaseNavigator } from '../navigation';
import { default as ROUTES } from '../constants/routeNames';
2018-10-05 06:42:27 +03:00
// Screens
2018-10-19 00:34:53 +03:00
import {
Splash, Login, PinCode, SteemConnect, Editor, Profile, Post,
2018-10-19 00:34:53 +03:00
} from '../screens';
2018-10-05 06:42:27 +03:00
// Components
import { SideMenu } from '../components';
2018-10-06 06:33:03 +03:00
const mainNavigation = DrawerNavigator(
2018-10-05 06:42:27 +03:00
{
[ROUTES.SCREENS.HOME]: {
2018-10-05 06:42:27 +03:00
screen: BaseNavigator,
},
},
{
contentComponent: SideMenu,
},
);
const stackNavigatior = createStackNavigator(
{
[ROUTES.DRAWER.MAIN]: {
screen: mainNavigation,
navigationOptions: {
header: () => null,
},
},
[ROUTES.SCREENS.PROFILE]: {
screen: Profile,
navigationOptions: {
header: () => null,
},
},
[ROUTES.SCREENS.POST]: {
screen: Post,
navigationOptions: {
header: () => null,
},
},
[ROUTES.SCREENS.EDITOR]: {
screen: Editor,
2018-10-05 06:42:27 +03:00
navigationOptions: {
header: () => null,
},
},
},
2018-10-05 06:42:27 +03:00
{
cardStyle: {
backgroundColor: 'white',
},
2018-10-05 06:42:27 +03:00
},
);
2018-10-06 06:33:03 +03:00
export default SwitchNavigator({
stackNavigatior,
[ROUTES.SCREENS.LOGIN]: { screen: Login },
[ROUTES.SCREENS.PINCODE]: { screen: PinCode },
[ROUTES.SCREENS.SPLASH]: { screen: Splash },
2018-10-26 11:01:13 +03:00
[ROUTES.SCREENS.STEEM_CONNECT]: { screen: SteemConnect },
2018-10-06 06:33:03 +03:00
});