-
Notifications
You must be signed in to change notification settings - Fork 97
/
Drawer.tsx
executable file
·38 lines (33 loc) · 957 Bytes
/
Drawer.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React from 'react';
import { SafeAreaView, Text, View, StyleSheet } from 'react-native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import TabNavigator from '../tab/Tab';
import { DrawerParamList } from './Drawer.typeDefs';
const Drawer = createDrawerNavigator<DrawerParamList>();
const styles = StyleSheet.create({
root: {
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
height: '100%',
},
});
const drawerContents = () => (
<SafeAreaView>
<View style={styles.root}>
<Text>Side Menu Contents</Text>
</View>
</SafeAreaView>
);
function DrawerNavigator() {
return (
<Drawer.Navigator
initialRouteName="MainDrawer"
screenOptions={{ headerShown: false }}
drawerContent={drawerContents}>
<Drawer.Screen name="MainDrawer" component={TabNavigator} />
</Drawer.Navigator>
);
}
export default DrawerNavigator;