2017-01-26 11:49:39 -08:00
|
|
|
/**
|
|
|
|
* @flow
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
2017-12-20 13:35:35 -08:00
|
|
|
import { Button, Platform, ScrollView, StatusBar } from 'react-native';
|
2017-10-31 11:33:40 -07:00
|
|
|
import { DrawerNavigator, SafeAreaView } from 'react-navigation';
|
2017-01-26 11:49:39 -08:00
|
|
|
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
|
|
import SampleText from './SampleText';
|
|
|
|
|
|
|
|
const MyNavScreen = ({ navigation, banner }) => (
|
2017-10-31 11:33:40 -07:00
|
|
|
<ScrollView>
|
|
|
|
<SafeAreaView forceInset={{ top: 'always' }}>
|
|
|
|
<SampleText>{banner}</SampleText>
|
|
|
|
<Button
|
|
|
|
onPress={() => navigation.navigate('DrawerOpen')}
|
|
|
|
title="Open drawer"
|
|
|
|
/>
|
|
|
|
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
|
|
|
</SafeAreaView>
|
2017-12-20 13:35:35 -08:00
|
|
|
<StatusBar barStyle="default" />
|
2017-01-26 11:49:39 -08:00
|
|
|
</ScrollView>
|
|
|
|
);
|
|
|
|
|
|
|
|
const InboxScreen = ({ navigation }) => (
|
2017-05-14 12:14:12 -07:00
|
|
|
<MyNavScreen banner={'Inbox Screen'} navigation={navigation} />
|
2017-01-26 11:49:39 -08:00
|
|
|
);
|
|
|
|
InboxScreen.navigationOptions = {
|
2017-04-13 00:49:08 +02:00
|
|
|
drawerLabel: 'Inbox',
|
|
|
|
drawerIcon: ({ tintColor }) => (
|
|
|
|
<MaterialIcons
|
|
|
|
name="move-to-inbox"
|
|
|
|
size={24}
|
|
|
|
style={{ color: tintColor }}
|
|
|
|
/>
|
|
|
|
),
|
2017-01-26 11:49:39 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
const DraftsScreen = ({ navigation }) => (
|
2017-05-14 12:14:12 -07:00
|
|
|
<MyNavScreen banner={'Drafts Screen'} navigation={navigation} />
|
2017-01-26 11:49:39 -08:00
|
|
|
);
|
|
|
|
DraftsScreen.navigationOptions = {
|
2017-04-13 00:49:08 +02:00
|
|
|
drawerLabel: 'Drafts',
|
|
|
|
drawerIcon: ({ tintColor }) => (
|
2017-05-14 12:14:12 -07:00
|
|
|
<MaterialIcons name="drafts" size={24} style={{ color: tintColor }} />
|
2017-04-13 00:49:08 +02:00
|
|
|
),
|
2017-01-26 11:49:39 -08:00
|
|
|
};
|
|
|
|
|
2017-05-14 12:14:12 -07:00
|
|
|
const DrawerExample = DrawerNavigator(
|
|
|
|
{
|
|
|
|
Inbox: {
|
|
|
|
path: '/',
|
|
|
|
screen: InboxScreen,
|
|
|
|
},
|
|
|
|
Drafts: {
|
|
|
|
path: '/sent',
|
|
|
|
screen: DraftsScreen,
|
|
|
|
},
|
2017-01-26 11:49:39 -08:00
|
|
|
},
|
2017-05-14 12:14:12 -07:00
|
|
|
{
|
2017-12-20 13:35:35 -08:00
|
|
|
drawerOpenRoute: 'DrawerOpen',
|
|
|
|
drawerCloseRoute: 'DrawerClose',
|
|
|
|
drawerToggleRoute: 'DrawerToggle',
|
2017-05-14 12:14:12 -07:00
|
|
|
initialRouteName: 'Drafts',
|
|
|
|
contentOptions: {
|
|
|
|
activeTintColor: '#e91e63',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
);
|
2017-01-26 11:49:39 -08:00
|
|
|
|
|
|
|
export default DrawerExample;
|