-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNavigation.js
68 lines (61 loc) · 2.13 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
import React from "react";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { createStackNavigator } from "@react-navigation/stack";
import { NavigationContainer } from "@react-navigation/native";
import Ionicons from "react-native-vector-icons/Ionicons";
import HomeScreen from "./screens/HomeScreen";
import SavedJobsScreen from "./screens/SavedJobsScreen";
import InboxScreen from "./screens/InboxScreen";
import ProfileScreen from "./screens/ProfileScreen";
import JobDetailsScreen from "./screens/JobDetailsScreen";
const Tab = createBottomTabNavigator();
const HomeStack = createStackNavigator();
function HomeStackScreen() {
return (
<HomeStack.Navigator>
<HomeStack.Screen
name="HomeScreen"
component={HomeScreen}
options={{ title: "Home" }}
/>
<HomeStack.Screen
name="JobDetails"
component={JobDetailsScreen}
options={{ title: "Job Details" }}
/>
</HomeStack.Navigator>
);
}
function Navigation() {
return (
<NavigationContainer>
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
if (route.name === "Home") {
iconName = focused ? "home" : "home-outline";
} else if (route.name === "Saved") {
iconName = focused ? "bookmark" : "bookmark-outline";
} else if (route.name === "Messages") {
iconName = focused ? "mail" : "mail-outline";
} else if (route.name === "Profile") {
iconName = focused ? "person" : "person-outline";
}
return <Ionicons name={iconName} size={size} color={color} />;
},
})}
>
<Tab.Screen
name="Home"
component={HomeStackScreen}
options={{ headerShown: false }}
/>
<Tab.Screen name="Saved" component={SavedJobsScreen} />
<Tab.Screen name="Messages" component={InboxScreen} />
<Tab.Screen name="Profile" component={ProfileScreen} />
</Tab.Navigator>
</NavigationContainer>
);
}
export default Navigation;