-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
62 lines (56 loc) · 2.12 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
53
54
55
56
57
58
59
60
61
62
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import {
DrawerContentScrollView,
DrawerItemList,
DrawerItem
} from '@react-navigation/drawer';
import { Ionicons, FontAwesome, AntDesign, MaterialCommunityIcons } from '@expo/vector-icons';
import Main from './components/Main';
import Add from './components/Add';
import { View } from 'react-native';
const Drawer = createDrawerNavigator();
export default function App() {
return (
<NavigationContainer>
<Drawer.Navigator drawerContent={(props) => <CustomDrawerContent {...props} />}>
<Drawer.Screen name="main" component={Main} options={{
drawerIcon: () => <FontAwesome name="sticky-note" size={24} color="white" />,
drawerLabel: 'Main',
headerTitle: 'Main',
drawerLabelStyle: { color: 'white' },
drawerActiveBackgroundColor: 'gray',
headerStyle: { backgroundColor: 'black' },
headerTintColor: 'white'
}} />
<Drawer.Screen name="add" component={Add} options={{
drawerIcon: () => <Ionicons name="add-circle" size={24} color="white" />,
drawerLabel: 'Add',
headerTitle: 'Add',
drawerLabelStyle: { color: 'white' },
drawerActiveBackgroundColor: 'gray',
headerStyle: { backgroundColor: 'black' },
headerTintColor: 'white'
}} />
</Drawer.Navigator>
</NavigationContainer>
);
}
function CustomDrawerContent(props) {
return (
<DrawerContentScrollView {...props} style={{ backgroundColor: 'black' }}>
<View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<MaterialCommunityIcons name="notebook" size={72} color="white" />
</View>
<DrawerItemList {...props} />
<DrawerItem
label="Info"
icon={() => <AntDesign name="infocirlce" size={24} color="white" />}
onPress={() => alert("noteApp 0.0.0.0.1")}
labelStyle={{ color: 'white' }}
activeBackgroundColor='gray'
/>
</DrawerContentScrollView>
);
}