-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.tsx
154 lines (149 loc) · 3.67 KB
/
App.tsx
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
import { FontAwesome, Ionicons, MaterialIcons } from '@expo/vector-icons'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import { NavigationContainer } from '@react-navigation/native'
import * as React from 'react'
// telas
import Home from './screens/HomeScreen'
import Maps from './screens/MapsScreen'
import Profile from './screens/ProfileScreen'
import About from './screens/RestaurantScreen/About'
import Category from './screens/RestaurantScreen/Category'
import Menu from './screens/RestaurantScreen/Menu'
import Ratings from './screens/RestaurantScreen/Ratings'
import Restaurants from './screens/RestaurantScreen/Restaurants'
const Tab: any = createBottomTabNavigator()
const App = (): JSX.Element => {
return (
<NavigationContainer>
<Tab.Navigator>
<Tab.Screen
name='Home'
component={Home}
options={{
tabBarIcon: ({ color }: any): React.ReactNode => (
<TabBarIcon name='home' size={32} color={color} />
),
headerShown: false
}}
/>
<Tab.Screen
name='Maps'
component={Maps}
options={{
tabBarIcon: ({ color }: any): React.ReactNode => (
<FontAwesome
name='map-marker'
size={32}
color={color}
/>
),
headerShown: false
}}
/>
<Tab.Screen
name='Restaurants'
component={Restaurants}
options={{
tabBarIcon: ({ color }: any): React.ReactNode => (
<Ionicons
name='restaurant'
size={32}
color={color}
/>
),
headerShown: false
}}
/>
<Tab.Screen
name='About'
component={About}
options={{
headerShown: false,
tabBarButton: (): React.ReactNode => null,
TabBarVisible: false
}}
// adds a back button to the header
listeners={({ navigation, route }: any): unknown => ({
tabPress: (e: any): void => {
e.preventDefault()
navigation.navigate('Restaurants')
}
})}
/>
<Tab.Screen
name='Profile'
component={Profile}
options={{
tabBarIcon: ({ color }: any): React.ReactNode => (
<MaterialIcons
name='account-circle'
size={32}
color={color}
/>
),
headerShown: false
}}
/>
<Tab.Screen
name='Category'
component={Category}
options={{
headerShown: false,
tabBarButton: (): React.ReactNode => null,
TabBarVisible: false
}}
/>
<Tab.Screen
name='Ratings'
component={Ratings}
options={{
headerShown: true,
headerTitle: 'Avaliações',
headerStyle: {
backgroundColor: '#fff',
elevation: 0,
shadowOpacity: 0,
borderBottomWidth: 0
},
headerTitleStyle: {
fontWeight: 'bold',
fontSize: 26,
color: '#963333'
},
headerTitleAlign: 'center',
headerTintColor: '#000',
tabBarButton: (): React.ReactNode => null,
TabBarVisible: false
}}
/>
<Tab.Screen
name='Menu'
component={Menu}
options={{
headerShown: true,
headerTitle: 'Cardápio',
headerStyle: {
backgroundColor: '#fff',
elevation: 0,
shadowOpacity: 0,
borderBottomWidth: 0
},
headerTitleStyle: {
fontWeight: 'bold',
fontSize: 26,
color: '#963333'
},
headerTitleAlign: 'center',
headerTintColor: '#000',
tabBarButton: (): React.ReactNode => null,
TabBarVisible: false
}}
/>
</Tab.Navigator>
</NavigationContainer>
)
}
const TabBarIcon = (props: React.PropsWithChildren): JSX.Element => {
return <FontAwesome size={30} style={{ marginBottom: -3 }} {...props} />
}
export default App