-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
50 lines (44 loc) · 1.56 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
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import Icon from 'react-native-vector-icons/FontAwesome';
import PrayerTimeScreen from './PrayerTimes';
import CalendarScreen from './CalendarScreen';
import SettingsScreen from './SettingsScreen';
import AboutUsScreen from './AboutUsScreen';
const Drawer = createDrawerNavigator();
const Tab = createBottomTabNavigator();
const TabNavigator = () => {
return (
<Tab.Navigator
screenOptions={({ route }) => ({
headerShown: false,
tabBarIcon: ({ color, size }) => {
let iconName;
if (route.name === 'Calendar') {
iconName = 'calendar';
} else if (route.name === 'Today') {
iconName = 'clock-o';
}
// You can return any component here
return <Icon name={iconName} size={size} color={color} />;
},
})}
>
<Tab.Screen name="Today" component={PrayerTimeScreen} />
<Tab.Screen name="Calendar" component={CalendarScreen} />
</Tab.Navigator>
);
}
export default function App() {
return (
<NavigationContainer>
<Drawer.Navigator initialRouteName="Home">
<Drawer.Screen name="Home" component={TabNavigator} />
<Drawer.Screen name="Settings" component={SettingsScreen} />
<Drawer.Screen name="About Us" component={AboutUsScreen} />
</Drawer.Navigator>
</NavigationContainer>
);
}