import React from 'react'; import { createSwitchNavigator } from 'react-navigation'; import { createBottomTabNavigator } from 'react-navigation-tabs'; import { createDrawerNavigator } from 'react-navigation-drawer'; import { createStackNavigator } from 'react-navigation-stack'; // Constants import ROUTES from '../constants/routeNames'; import scalePx from '../utils/scalePx'; // Components import { Icon, IconContainer } from '../components/icon'; import { PostButton, BottomTabBar, SideMenu } from '../components'; // Screens import { Bookmarks, Boost, Drafts, Editor, Feed, Follows, Login, Notification, Post, Profile, ProfileEdit, Reblogs, Redeem, Register, SearchResult, Settings, SpinGame, Transfer, Voters, Wallet, AccountBoost, TagResult, Community, Communities, WebBrowser, ReferScreen, CoinDetails, EditHistoryScreen, } from '../screens'; const bottomTabNavigator = createBottomTabNavigator( { [ROUTES.TABBAR.FEED]: { screen: Feed, navigationOptions: () => ({ tabBarIcon: ({ tintColor }) => ( ), }), }, [ROUTES.TABBAR.NOTIFICATION]: { screen: Notification, navigationOptions: () => ({ tabBarIcon: ({ tintColor }) => ( ), }), }, [ROUTES.TABBAR.POST_BUTTON]: { screen: () => null, navigationOptions: { tabBarIcon: () => , }, }, [ROUTES.TABBAR.WALLET]: { screen: Wallet, navigationOptions: () => ({ tabBarIcon: ({ tintColor }) => ( ), }), }, [ROUTES.TABBAR.PROFILE]: { screen: Profile, navigationOptions: () => ({ tabBarIcon: ({ tintColor }) => ( ), }), }, }, { tabBarComponent: (props) => , tabBarOptions: { showLabel: false, activeTintColor: '#357ce6', inactiveTintColor: '#c1c5c7', }, }, ); const mainNavigation = createDrawerNavigator( { [ROUTES.SCREENS.FEED]: { screen: bottomTabNavigator } }, { contentComponent: SideMenu }, ); const stackNavigator = createStackNavigator( { [ROUTES.DRAWER.MAIN]: { screen: mainNavigation }, [ROUTES.SCREENS.PROFILE]: { screen: Profile }, [ROUTES.SCREENS.PROFILE_EDIT]: { screen: ProfileEdit }, [ROUTES.SCREENS.POST]: { screen: Post, navigationOptions: { gesturesEnabled: true, gestureResponseDistance: { horizontal: 70 }, }, }, [ROUTES.SCREENS.EDITOR]: { screen: Editor }, [ROUTES.SCREENS.VOTERS]: { screen: Voters }, [ROUTES.SCREENS.FOLLOWS]: { screen: Follows }, [ROUTES.SCREENS.SETTINGS]: { screen: Settings }, [ROUTES.SCREENS.DRAFTS]: { screen: Drafts }, [ROUTES.SCREENS.BOOKMARKS]: { screen: Bookmarks }, [ROUTES.SCREENS.SEARCH_RESULT]: { screen: SearchResult }, [ROUTES.SCREENS.TAG_RESULT]: { screen: TagResult }, [ROUTES.SCREENS.TRANSFER]: { screen: Transfer }, [ROUTES.SCREENS.BOOST]: { screen: Boost }, [ROUTES.SCREENS.REDEEM]: { screen: Redeem }, [ROUTES.SCREENS.REBLOGS]: { screen: Reblogs }, [ROUTES.SCREENS.SPIN_GAME]: { screen: SpinGame }, [ROUTES.SCREENS.ACCOUNT_BOOST]: { screen: AccountBoost }, [ROUTES.SCREENS.COMMUNITY]: { screen: Community }, [ROUTES.SCREENS.COMMUNITIES]: { screen: Communities }, [ROUTES.SCREENS.WEB_BROWSER]: { screen: WebBrowser }, [ROUTES.SCREENS.REFER]: { screen: ReferScreen }, [ROUTES.SCREENS.COIN_DETAILS]: { screen: CoinDetails }, [ROUTES.SCREENS.EDIT_HISTORY]: { screen: EditHistoryScreen }, }, { headerMode: 'none', }, ); export default createSwitchNavigator({ stackNavigator, [ROUTES.SCREENS.REGISTER]: { screen: Register }, [ROUTES.SCREENS.LOGIN]: { screen: Login }, });