Skip to content

Instantly share code, notes, and snippets.

@mauriciopazpp
Created August 7, 2018 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauriciopazpp/e96a68c4f34ee66c375847be39870065 to your computer and use it in GitHub Desktop.
Save mauriciopazpp/e96a68c4f34ee66c375847be39870065 to your computer and use it in GitHub Desktop.
react-native drawer
import React from 'react';
import {createDrawerNavigator, DrawerItems} from 'react-navigation';
import Home from '../screens/Home';
import {Image} from "react-native";
import styles from '../styles/Drawer.style';
import Constants from '../constants/Constant';
import { Icon } from "react-native-elements";
const DrawerNav = createDrawerNavigator({
"Now Playing": {
navigationOptions: {
drawerIcon: () => (
<Icon name='alarm'
color='#F50057'/>
),
},
screen: (props) => <Home {...props} propName={Constants.TITLE_NOW_PLAYING} />
},
"Popular": {
navigationOptions: {
drawerIcon: () => (
<Icon name='shop'
color='#F50057'/>
),
},
screen: (props) => <Home {...props} propName={Constants.TITLE_POPULAR} />
},
"Top Rated": {
navigationOptions: {
drawerIcon: () => (
<Icon name='favorite'
color='#F50057'/>
),
},
screen: (props) => <Home {...props} propName={Constants.TITLE_TOP_RATED} />
},
"Upcoming": {
navigationOptions: {
drawerIcon: () => (
<Icon name='book'
color='#F50057'/>
),
},
screen: (props) => <Home {...props} propName={Constants.TITLE_UPCOMING} />
}
}, {
initialRouteName: 'Now Playing',
drawerPosition: 'left',
contentOptions: {
activeTintColor: '#F50057',
inactiveTintColor :'#1999CE',
activeBackgroundColor :'#E8EAF6',
},
drawerOpenRoute: 'DrawerOpen',
drawerCloseRoute: 'DrawerClose'
}
);
export default DrawerNav;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment