-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.js
64 lines (54 loc) · 2.46 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
63
import React, { useEffect } from 'react'
import { NavigationContainer, DrawerActions } from '@react-navigation/native'
import { createStackNavigator } from '@react-navigation/stack'
import { createDrawerNavigator } from '@react-navigation/drawer'
import { FontAwesome, Ionicons, AntDesign } from '@expo/vector-icons'
import Login from './components/Login'
import Home from './components/Home'
import Logout from './components/Logout'
import Dashboard from './components/Dashboard'
import Country from './components/Country'
import HealthAdvice from './components/HealthAdvice'
import Profile from './components/Profile'
import { setLocalNotification } from './utils/helpers'
const Drawer = createDrawerNavigator()
DrawerT = ({ navigation }) => {
navigation.setOptions({
title: 'COVID-19 PANDEMIC',
headerLeft: () => (
<FontAwesome style={{ marginLeft: 14 }} name='bars' size={40} color={'black'} onPress={() => navigation.dispatch(DrawerActions.toggleDrawer())} />
),
})
return (
<Drawer.Navigator initialRouteName="Home">
<Drawer.Screen name="Home" component={Home} options={{ drawerIcon: () => <Ionicons name='md-home' size={30} color={"#007bff"} /> }} />
<Drawer.Screen name="Dashboard" component={Dashboard} options={{ drawerIcon: () => <FontAwesome name='dashboard' size={25} color={"#007bff"} /> }} />
<Drawer.Screen name="Country" component={Country} options={{ drawerIcon: () => <AntDesign name='earth' size={25} color={"#007bff"} /> }} />
<Drawer.Screen name="HealthAdvice" component={HealthAdvice} options={{ title: "Health Care", drawerIcon: () => <Ionicons name='md-information-circle' size={30} color={"#007bff"} /> }} />
<Drawer.Screen name="Profile" component={Profile} options={{ title: "My Profile", drawerIcon: () => <AntDesign name='user' size={25} color={"#007bff"} /> }} />
<Drawer.Screen name="Logout" component={Logout} options={{ drawerIcon: () => <Ionicons name='md-exit' size={30} color={"red"} /> }} />
</Drawer.Navigator>
)
}
const Stack = createStackNavigator()
export default function App() {
useEffect(() => {
//console.log("notify")
setLocalNotification()
}, [])
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Login"
component={Login}
options={{ title: 'Welcome' }}
/>
<Stack.Screen
name="DrawerT"
component={DrawerT}
/>
</Stack.Navigator>
</NavigationContainer>
)
}