-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
52 lines (50 loc) · 1.39 KB
/
App.js
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* eslint-disable react-native/no-inline-styles */
import * as React from 'react';
import {View, Text, Linking} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {
createDrawerNavigator,
DrawerContentScrollView,
DrawerItemList,
DrawerItem,
} from '@react-navigation/drawer';
import MainHomePage from './src/MainHomePage';
function CustomDrawerContent(props) {
return (
<DrawerContentScrollView {...props}>
<View
style={{
backgroundColor: '#f50057',
height: 140,
alignItems: 'center',
justifyContent: 'center',
}}>
<Text style={{color: 'white', fontSize: 30}}>Header</Text>
</View>
<DrawerItem
label="IconHeader"
onPress={() => Linking.openUrl('https://google.com')}
/>
<DrawerItem
label="Help"
onPress={() => Linking.openUrl('https://google.com')}
/>
<DrawerItemList {...props} />
</DrawerContentScrollView>
);
}
export default function App() {
const Drawer = createDrawerNavigator();
return (
<NavigationContainer>
<Drawer.Navigator
drawerType={'front'}
drawerStyle={{
width: 240,
}}
drawerContent={props => <CustomDrawerContent {...props} />}>
<Drawer.Screen name="Home" component={MainHomePage} />
</Drawer.Navigator>
</NavigationContainer>
);
}