-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
71 lines (67 loc) · 2.19 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
import { StatusBar } from "expo-status-bar";
import { Button, StyleSheet, Text, View } from "react-native";
import CategoriaTela from "./screens/CategoriaTela";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { createDrawerNavigator } from "@react-navigation/drawer";
import PratosVisaoGeralTela from "./screens/PratosVisaoGeralTela";
import PratoDetalheTela from "./screens/PratoDetalheTela";
import FavoritosTela from "./screens/FavoritosTela";
import { FontAwesome } from "@expo/vector-icons";
import FavoritosContextProvider from "./store/context/favoritos-context";
const Stack = createNativeStackNavigator();
const Drawer = createDrawerNavigator();
export default function App() {
function DrawerNavigator() {
return (
<Drawer.Navigator>
<Drawer.Screen
name="Categorias"
component={CategoriaTela}
options={{
drawerIcon: ({ color, size }) => (
<FontAwesome name="cutlery" color={color} size={size} />
),
}}
/>
<Drawer.Screen
name="Favoritos"
component={FavoritosTela}
options={{
drawerIcon: ({ color, size }) => (
<FontAwesome name="star" color={color} size={size} />
),
}}
/>
</Drawer.Navigator>
);
}
return (
<FavoritosContextProvider>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="PrimeiraTela"
component={DrawerNavigator}
options={{ headerShown: false }}
/>
{/* <Stack.Screen name="Categorias" component={CategoriaTela} /> */}
<Stack.Screen
name="PratosVisaoGeral"
component={PratosVisaoGeralTela}
options={{ title: "Pratos" }}
/>
<Stack.Screen name="PratoDetalhe" component={PratoDetalheTela} />
</Stack.Navigator>
</NavigationContainer>
</FavoritosContextProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});