-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
65 lines (59 loc) · 2.11 KB
/
Copy pathApp.js
File metadata and controls
65 lines (59 loc) · 2.11 KB
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
import { StyleSheet, Text, View } from "react-native";
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { createStackNavigator } from "@react-navigation/stack";
import { FontAwesome } from "@expo/vector-icons";
import { Ionicons } from "@expo/vector-icons";
import LoginScreen from "./screens/LoginScreen";
import HomeStack from "./screens/HomeScreen";
import EventStack from "./screens/EventStack";
import React, { useEffect } from "react";
// useful links
// icons.expo.fyi
// https://reactnavigation.org/docs/bottom-tab-navigator/
// https://reactnavigation.org/docs/nesting-navigators/
const Tab = createBottomTabNavigator();
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
//Set the icon based on which route it is (name of the tab)
if (route.name === "Home") {
iconName = focused ? "ios-home" : "ios-home-outline";
} else if (route.name === "Events") {
iconName = focused ? "ios-calendar" : "ios-calendar-outline";
}
// You can return any component that you like here!
return <Ionicons name={iconName} size={size} color={color} />;
},
tabBarActiveTintColor: "#0D532F",
tabBarInactiveTintColor: "black",
tabBarActiveBackgroundColor: "#9EC1A3",
tabBarInactiveBackgroundColor: "#9EC1A3",
})}
>
<Tab.Screen
name="Events"
options={{ headerShown: false }}
component={EventStack}
/>
<Tab.Screen
name="Home"
options={{ headerShown: false }}
component={HomeStack}
/>
</Tab.Navigator>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});