-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
71 lines (67 loc) · 1.98 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 "react-native-gesture-handler";
import { Text, View, Button } from "react-native";
import { StatusBar } from "expo-status-bar";
import { createStackNavigator } from "@react-navigation/stack";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { NavigationContainer } from "@react-navigation/native";
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
import { Fontisto } from "@expo/vector-icons";
import Home from "./screens/Home";
import Favorites from "./screens/Favorites";
import { PlacesProvider } from "./context/PlacesContext";
import Toast from "react-native-toast-message";
const Stack = createStackNavigator();
const Tab = createBottomTabNavigator();
export default function App() {
return (
<PlacesProvider>
<NavigationContainer>
<Stack.Navigator initialRouteName="Main">
<Stack.Screen
name="Main"
component={MyTabs}
options={{ headerShown: false }}
/>
</Stack.Navigator>
</NavigationContainer>
<Toast />
</PlacesProvider>
);
}
function MyTabs() {
return (
<Tab.Navigator
initialRouteName="Home"
screenOptions={{
tabBarActiveTintColor: "#3F51B5",
// headerShown:false,
headerStyle: {
backgroundColor: "#3F51B5",
},
headerTintColor: "#fff",
}}
>
<Tab.Screen
name="Home"
component={Home}
options={{
tabBarLabel: "Home",
headerShown: false,
tabBarIcon: ({ color, size }) => (
<MaterialCommunityIcons name="home" color={color} size={size} />
),
}}
/>
<Tab.Screen
name="Favorites"
component={Favorites}
options={{
tabBarLabel: "Favorites",
tabBarIcon: ({ color, size }) => (
<Fontisto name="favorite" size={24} color={color} size={size} />
),
}}
/>
</Tab.Navigator>
);
}