-
Notifications
You must be signed in to change notification settings - Fork 0
/
Navigators.js
158 lines (139 loc) · 4.54 KB
/
Navigators.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import React from "react";
import { useState } from "react";
//Navigators
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
//Icons librarie
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
//Bottom screens
import Home from "./src/Screens/Home";
import Market from "./src/Screens/Market";
import History from "./src/Screens/History";
//Stack screens
import Gain from "./src/Screens/Gain";
import Expense from "./src/Screens/Expense";
import SelectCategories from "./src/Screens/SelectCategories";
import ConfirmationScreen from "./src/Screens/ConfirmationScreen";
import Profile from "./src/Screens/Profile";
import Login from "./src/Screens/Login";
const Stack = createNativeStackNavigator();
const Stacks = () =>{
return(
<Stack.Navigator
screenOptions={{
initialRouteName: 'Login',
headerStyle:{
backgroundColor:'#2F2F2F',
}
}}>
<Stack.Screen
name="Login"
component={Login}
options={{
headerShown:false,
}}
/>
<Stack.Screen
name="HomeScreen"
component={Home}
options={{
headerShown:false,
}}
/>
<Stack.Screen
name="Profile"
component={Profile}
options={{
headerBackTitleVisible:false,
headerTintColor:'#D39F00',
headerTitle: "Perfil"
}}
/>
<Stack.Screen
name="Gain"
component={Gain}
options={{
headerBackTitleVisible:false,
headerTintColor:'#D39F00',
headerTitle: "Ingrese el monto"
}}
/>
<Stack.Screen
name="Expense"
component={Expense}
options={{
headerBackTitleVisible:false,
headerTintColor:'#D39F00',
headerTitle: "Ingrese el monto"
}}
/>
<Stack.Screen
name="SelectCategories"
component={SelectCategories}
options={{
headerBackTitleVisible:false,
headerTintColor:'#D39F00',
headerTitle: "Seleccione una categoria"
}}
/>
<Stack.Screen
name="ConfirmationScreen"
component={ConfirmationScreen}
options={{
headerBackTitleVisible:false,
headerTintColor:'#D39F00',
headerTitle: "Confirme su seleccion"
}}
/>
</Stack.Navigator>
)
}
const Tab = createBottomTabNavigator()
const TabNavigation = () =>{
return(
<Tab.Navigator
screenOptions={{
initialRouteName: 'Home',//The initial screen of the application
tabBarActiveTintColor: '#f5f5fa',
tabBarInactiveTintColor: '#0f0c0c',
headerShown: false,//Hide the top tab
tabBarStyle:{
backgroundColor: '#D39F00',
},
}}
>
<Tab.Screen name="Inicio"
component={Stacks}
options={{
tabBarIcon:()=>(
<MaterialCommunityIcons name="home" color={'#000'} size={35}/>//Home icon
)
}}
/>
<Tab.Screen name="Mercado"
component={Market}
options={{
tabBarIcon:()=>(
<MaterialCommunityIcons name="finance" size={35} color="black" />//Market icon
)
}}
/>
<Tab.Screen name="Historial"
component={History}
options={{
tabBarIcon:()=>(
<MaterialCommunityIcons name="history" size={35} color="black" />
)
}}
/>
</Tab.Navigator>
);
}
export default Navigations = () =>{
return(
<NavigationContainer>
<TabNavigation/>
</NavigationContainer>
)
}