This repository has been archived by the owner on Oct 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
72 lines (65 loc) · 2.13 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
70
71
72
import { StatusBar } from "expo-status-bar";
import React from "react";
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import Ionicons from "react-native-vector-icons/Ionicons";
import { Avatar, Hamburger } from "./components/AppBar";
// Screens
import HomeScreen from "./screens/HomeScreen";
import ExploreScreen from "./screens/ExploreScreen";
import NotificationScreen from "./screens/NotificationScreen";
import WalletScreen from "./screens/WalletScreen";
const Tab = createBottomTabNavigator();
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let icon;
if (route.name == "~/creatv") {
icon = focused ? "home" : "home-outline";
} else if (route.name == "Explore") {
icon = focused ? "search" : "search-outline";
} else if (route.name == "Notifications") {
icon = focused ? "notifications" : "notifications-outline";
} else if (route.name == "Wallet") {
icon = focused ? "wallet" : "wallet-outline";
}
return <Ionicons name={icon} size={30} />;
},
})}
tabBarOptions={{ showLabel: false }}
>
<Tab.Screen
name="~/creatv"
component={HomeScreen}
options={headerOptions}
/>
<Tab.Screen
name="Explore"
component={ExploreScreen}
options={headerOptions}
/>
<Tab.Screen
name="Notifications"
component={NotificationScreen}
options={headerOptions}
/>
<Tab.Screen
name="Wallet"
component={WalletScreen}
options={headerOptions}
/>
</Tab.Navigator>
<StatusBar style="auto" />
</NavigationContainer>
);
}
/**
* TODO: Add different header sections for screen i.e. Search Bar in explore
*/
const headerOptions = {
headerLeft: () => <Avatar />,
headerRight: () => <Hamburger />,
};