-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
69 lines (65 loc) · 2.35 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
64
65
66
67
68
69
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import Ionicons from "@expo/vector-icons/Ionicons";
import { Octicons, MaterialCommunityIcons } from "@expo/vector-icons";
const Tab = createBottomTabNavigator();
import Home from "./screens/Home";
import Notifications from "./screens/Notifications";
import Explore from "./screens/Explore";
import Profile from "./screens/Profile";
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator
initialRouteName="Home"
screenOptions={({ route }) => ({
headerTransparent: true,
headerTitle: "",
tabBarIcon: ({ focused, color, size }) => {
let iconName;
let routeName = route.name;
if (routeName === "Home") {
iconName = focused ? "home" : "home-outline";
} else if (routeName === "Notifications") {
iconName = focused ? "notifications" : "notifications-outline";
} else if (routeName === "Explore") {
iconName = "telescope";
} else if (routeName === "Profile") {
iconName = focused ? "person" : "person-outline";
}
return iconName !== "telescope" ? (
<Ionicons name={iconName} size={size} color={color}></Ionicons>
) : (
<Octicons name="telescope" size={size} color={color} />
);
},
activeTintColor: "#007bff",
inactiveTintColor: "#8e8e8e",
tabBarStyle: {
height: "10%",
backgroundColor: "rgba(44,44,47,255)",
borderTopWidth: 0,
borderTopColor: "#8e8e8e",
shadowColor: "#000",
shadowOffset: {
width: 0,
height: -2,
},
shadowOpacity: 0.1,
shadowRadius: 1.5,
elevation: 2,
},
tabBarLabelStyle: {
fontSize: 12,
marginTop: -4,
},
})}
>
<Tab.Screen name="Home" component={Home} />
<Tab.Screen name="Notifications" component={Notifications} />
<Tab.Screen name="Explore" component={Explore} />
<Tab.Screen name="Profile" component={Profile} />
</Tab.Navigator>
</NavigationContainer>
);
}