-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
80 lines (68 loc) · 3.09 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
import * as React from 'react';
import { Text, SafeAreaView, StyleSheet, Image, View, Button } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import Icon from 'react-native-vector-icons/Ionicons';
//Stack navigator
import TelaIniciall from './telas/telaInicial';
import TelaLoginn from './telas/telaLogin';
import TelaCadastro from './telas/telaCadastro';
//Tab navigator
import TelaMoedas from './telas/telaMoedas';
import TelaConversao from './telas/telaConversao'
import TelaPerfil from './telas/telaPerfil';
import TelaNoticias from './telas/TelaNoticias';
//Objetos usados para a criação de navegação
const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator();
function TabViews() {
return (
<Tab.Navigator
initialRouteName='Moedas'
screenOptions={({ route }) => ({
tabBarActiveTintColor: '#FFB45B',
tabBarInactiveTintColor: 'white',
headerShown: false,
tabBarStyle: {
backgroundColor: '#020507',
borderTopWidth: 0,
},
tabBarIcon: ({ focused, color, size }) => {
let iconName;
if (route.name === 'Moedas') {
iconName = focused ? 'server' : 'server-outline';
} else if (route.name === 'Conversao') {
iconName = focused ? 'swap-vertical' : 'swap-vertical-outline';
} else if (route.name === 'Perfil') {
iconName = focused ? 'person' : 'person-outline';
}else if (route.name === 'Noticias') {
iconName = focused ? 'newspaper' : 'newspaper-outline';
}
// Você pode retornar qualquer componente que quiser aqui!
return <Icon name={iconName} size={size} color={color} />;
},
})}
>
<Tab.Screen name={'Moedas'} component={TelaMoedas} />
<Tab.Screen name={'Conversao'} component={TelaConversao} />
<Tab.Screen name={'Noticias'} component={TelaNoticias} />
<Tab.Screen name={'Perfil'} component={TelaPerfil} />
</Tab.Navigator>
);
}
export default function App() {
return (
<NavigationContainer>
<Stack.Navigator initialRouteName=" ">
<Stack.Screen name=" " options={{ headerStyle: { backgroundColor: '#040D12'}, headerShown: false,}} component={TelaIniciall} />
<Stack.Screen name="Login" options={{ headerStyle: { backgroundColor: '#040D12'}, headerShown: false,}}component={TelaLoginn} />
<Stack.Screen name="Cadastro" options={{ headerStyle: { backgroundColor: '#040D12'}, headerShown: false,}}component={TelaCadastro} />
<Stack.Screen name="Noticias" options={{ headerStyle: { backgroundColor: '#040D12'}, headerShown: false,}}component={TelaNoticias} />
<Stack.Screen name="TabViews" options={{ headerStyle: { backgroundColor: '#040D12'}, headerShown: false,}}component={TabViews} />
</Stack.Navigator>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
});