-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
92 lines (89 loc) · 3.17 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import { StatusBar } from "expo-status-bar";
import { Text, View } from "react-native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import Icon from "react-native-vector-icons/Ionicons";
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import HomeScreen from "./src/screens/HomeScreen";
import LoginScreen from "./src/screens/LoginScreen";
import PortofolioScreen from "./src/screens/PortofolioScreen";
import RewardsScreen from "./src/screens/RewardsScreen";
import MarketScreen from "./src/screens/MarketScreen";
import ProfileScreen from "./src/screens/ProfileScreen";
import DepositScreen from "./src/screens/DepositScreen";
import MarketItemScreen from "./src/screens/MarketItemScreen";
import ProfileDetailsScreen from "./src/screens/profile/ProfileDetailsScreen";
export default function App() {
const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator();
const MyTabs = () => (
<Tab.Navigator
initialRouteName="Home"
screenOptions={({ route }) => ({
headerShown: false,
tabBarIcon: ({ focused, color, size }) => {
let iconName;
switch (route.name) {
case "Home":
iconName = focused ? "home" : "home-outline";
break;
case "Portofolio":
iconName = focused ? "pie-chart" : "pie-chart-outline";
break;
case "Rewards":
iconName = focused ? "gift" : "gift-outline";
break;
case "Market":
iconName = focused ? "analytics" : "analytics-outline";
break;
case "Profile":
iconName = focused ? "person" : "person-outline";
break;
}
return <Icon name={iconName} color={color} size={size} />;
},
})}
>
<Tab.Screen name="Home" component={HomeScreen} />
<Tab.Screen name="Portofolio" component={PortofolioScreen} />
<Tab.Screen name="Rewards" component={RewardsScreen} />
<Tab.Screen name="Market" component={MarketScreen} />
<Tab.Screen name="Profile" component={ProfileScreen} />
</Tab.Navigator>
);
return (
<NavigationContainer>
<Stack.Navigator initialRouteName="Tabs">
<Stack.Screen
name="Login"
screenOptions={{
contentStyle: {
backgroundColor: "#FFFFFF",
},
}}
component={LoginScreen}
/>
<Stack.Screen
options={{ headerShown: false }}
name="Tabs"
component={MyTabs}
></Stack.Screen>
<Stack.Screen
options={{ headerShown: false }}
name="Deposit"
component={DepositScreen}
></Stack.Screen>
<Stack.Screen
options={{ headerShown: false }}
name="MarketItem"
component={MarketItemScreen}
></Stack.Screen>
<Stack.Screen
options={{ headerShown: false }}
name="ProfileDetails"
component={ProfileDetailsScreen}
></Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
);
}