-
Notifications
You must be signed in to change notification settings - Fork 1
/
navigation.js
81 lines (76 loc) · 2.51 KB
/
navigation.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import React from "react";
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { FontAwesome } from "@expo/vector-icons";
import { MaterialIcons } from "@expo/vector-icons";
import Home from "./screens/Home";
import Booking from "./screens/Booking";
import User from "./screens/User";
import Services from "./screens/Services";
import Docprofile from "./screens/Docprofile";
const Tab = createBottomTabNavigator();
const Stack = createNativeStackNavigator();
const BottomTabs = () => {
return (
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarShowLabel: false,
tabBarStyle: {
height: 60,
backgroundColor: "#f8f9fa",
borderTopWidth: 0,
shadowOffset: {
width: 5,
height: 3,
},
shadowColor: "black",
shadowOpacity: 0.5,
shadowRadius: 5,
elevation: 5,
},
tabBarIcon: ({ focused }) => {
let iconName;
if (route.name === "Home") {
iconName = "home";
} else if (route.name === "Booking") {
iconName = "list-alt";
} else if (route.name === "User") {
iconName = "user";
} else if (route.name === "Services") {
return (
<MaterialIcons
name="category"
size={27}
color={focused ? "#5dbe74" : "#6c757d"}
/>
);
}
return (
<FontAwesome
name={iconName}
size={26}
color={focused ? "#5dbe74" : "#6c757d"}
/>
);
},
})}
>
<Tab.Screen name="Home" component={Home} options={{ headerShown: false }} />
<Tab.Screen name="Services" component={Services} options={{ headerShown: false }} />
<Tab.Screen name="Booking" component={Booking} options={{ headerShown: false }} />
<Tab.Screen name="User" component={User} options={{ headerShown: false }} />
</Tab.Navigator>
);
};
const AppNavigator = () => {
return (
<NavigationContainer>
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="Bottomtabs" component={BottomTabs} />
<Stack.Screen name="Docprofile" component={Docprofile} />
</Stack.Navigator>
</NavigationContainer>
);
};
export default AppNavigator;