Skip to content

Instantly share code, notes, and snippets.

@artyorsh
Created October 23, 2019 15:30
Show Gist options
  • Save artyorsh/982afff1b243723e6e1c6890834ad6ad to your computer and use it in GitHub Desktop.
Save artyorsh/982afff1b243723e6e1c6890834ad6ad to your computer and use it in GitHub Desktop.
Home Navigator with Drawer and Tabs (Binding React Navigation 5 to Eva Design System)
import React from 'react';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { BottomHomeScreen, DrawerHomeScreen, AboutScreen } from '@app-scenes/home';
import { TodoNavigator } from './todo.navigator';
import { ProfileNavigator } from './profile.navigator';
import { AppRoute } from './app-routes';
const Drawer = createDrawerNavigator();
const BottomTab = createBottomTabNavigator();
const HomeBottomNavigator = (): React.ReactElement => (
<BottomTab.Navigator tabBarComponent={BottomHomeScreen}>
<BottomTab.Screen name={AppRoute.TODO} component={TodoNavigator}/>
<BottomTab.Screen name={AppRoute.PROFILE} component={ProfileNavigator}/>
</BottomTab.Navigator>
);
export const HomeNavigator = (): React.ReactElement => (
<Drawer.Navigator contentComponent={DrawerHomeScreen}>
<Drawer.Screen name={AppRoute.HOME} component={HomeBottomNavigator}/>
<Drawer.Screen name={AppRoute.ABOUT} component={AboutScreen}/>
</Drawer.Navigator>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment