Skip to content

Instantly share code, notes, and snippets.

@daniele-zurico
Created July 18, 2018 14:41
Show Gist options
  • Save daniele-zurico/d8f3847ec8b661455399d2c160705d58 to your computer and use it in GitHub Desktop.
Save daniele-zurico/d8f3847ec8b661455399d2c160705d58 to your computer and use it in GitHub Desktop.
import React from 'react';
import { createDrawerNavigator, createStackNavigator } from 'react-navigation';
import { Home, Categories } from './views/';
import { MenuButton } from './common';
import { Button } from 'react-native';
import Theme from './common/style/theme.style';
const StackHomeNavigator = createStackNavigator(
{
Home: {
screen: Home,
navigationOptions: {
title: 'Home',
},
},
},
{
navigationOptions: ({ navigation }) => ({
headerLeft: <MenuButton navigation={navigation} />,
headerStyle: {
backgroundColor: Theme.PRIMARY_COLOR,
},
headerTitleStyle: {
color: '#fff',
},
headerTintColor: {
color: 'red',
},
}),
}
);
const StackCategoriesNavigator = createStackNavigator(
{
Home: {
screen: Categories,
navigationOptions: {
title: 'Categories',
},
},
},
{
navigationOptions: ({ navigation }) => ({
headerLeft: <MenuButton navigation={navigation} />,
headerStyle: {
backgroundColor: Theme.PRIMARY_COLOR,
},
headerTitleStyle: {
color: '#fff',
},
headerTintColor: {
color: 'red',
},
}),
}
);
export const Drawer = createDrawerNavigator({
Home: {
screen: StackHomeNavigator,
},
Categories: {
screen: StackCategoriesNavigator,
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment