-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBottomTabNavigator.js
63 lines (58 loc) · 1.87 KB
/
BottomTabNavigator.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, { Component } from "react";
import { View } from "react-native";
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import Ionicons from "react-native-vector-icons/Ionicons";
import RideScreen from "../screens/Ride";
import RideHistoryScreen from "../screens/RideHistory";
const Tab = createBottomTabNavigator();
export default class BottomTabNavigator extends Component {
render() {
return (
<NavigationContainer>
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
if (route.name === "Ride") {
iconName = "bicycle";
} else if (route.name === "Ride History") {
iconName = "time";
}
// You can return any component that you like here!
return (
<Ionicons
name={iconName}
size={size}
color={color}
size={size}
/>
);
}
})}
tabBarOptions={{
activeTintColor: "#FBE5C0",
inactiveTintColor: "black",
style: {
height: 100,
borderTopWidth: 0,
backgroundColor: "#F88379"
},
labelStyle: {
fontSize: 20,
fontFamily: "Rajdhani_600SemiBold"
},
labelPosition: "below-icon",
tabStyle: {
alignItems: "center",
justifyContent: "center"
}
}}
>
<Tab.Screen name="Ride" component={RideScreen} />
<Tab.Screen name="Ride History" component={RideHistoryScreen} />
</Tab.Navigator>
</NavigationContainer>
);
}
}