Created
August 7, 2018 00:01
-
-
Save mauriciopazpp/e96a68c4f34ee66c375847be39870065 to your computer and use it in GitHub Desktop.
react-native drawer
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 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