-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
120 lines (114 loc) · 3.57 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
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
import { StatusBar } from "expo-status-bar";
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import { useFonts } from "expo-font";
import Colors from "./constants/Colors";
import AppLoading from "expo-app-loading";
import { enableScreens } from "react-native-screens";
// Navigation Packages
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
// React-Redux
import { Provider } from "react-redux";
import { store } from "./store/";
// Screens and Icons
import { Ionicons } from "@expo/vector-icons";
import HomeAndProfileStack from "./components/HomeAndProfileStack";
import FavoritesAndProfileStack from "./components/FavoritesAndProfileStack";
// Navigators
const Tabs = createBottomTabNavigator();
enableScreens();
export default function App() {
const [fontsLoaded] = useFonts({
Quicksand: require("./assets/fonts/Quicksand-Regular.ttf"),
"Quicksand-SB": require("./assets/fonts/Quicksand-SemiBold.ttf"),
"Quicksand-Bold": require("./assets/fonts/Quicksand-Bold.ttf"),
});
if (!fontsLoaded) return <AppLoading />;
return (
<Provider store={store}>
<NavigationContainer>
<StatusBar style="light" translucent={true} />
<Tabs.Navigator
tabBarOptions={{
style: {
borderTopWidth: 0,
minHeight: 60,
},
showLabel: false,
activeTintColor: Colors.secondary,
inactiveTintColor: "rgba(0,0,0,0.5)",
}}
>
<Tabs.Screen
name="Home"
component={HomeAndProfileStack}
options={{
tabBarIcon: (props) => {
const focusedTextStyles = {
color: props.color,
fontFamily: "Quicksand-Bold",
};
return (
<View style={styles.iconContainer}>
<Ionicons
name={props.focused ? "home" : "home-outline"}
size={props.size}
color={props.color}
/>
<Text style={[styles.tabText, focusedTextStyles]}>
Home
</Text>
</View>
);
},
}}
/>
<Tabs.Screen
name="Favorites"
component={FavoritesAndProfileStack}
options={{
tabBarIcon: (props) => (
<View style={styles.iconContainer}>
<Ionicons
name={props.focused ? "star" : "star-outline"}
size={props.size}
color={props.color}
/>
<Text
style={[
styles.tabText,
{
color: props.color,
fontFamily: props.focused
? "Quicksand-Bold"
: "Quicksand-SB",
},
]}
>
Favorites
</Text>
</View>
),
}}
/>
</Tabs.Navigator>
</NavigationContainer>
</Provider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Colors.primary,
justifyContent: "center",
},
iconContainer: {
justifyContent: "center",
alignItems: "center",
// width: 45,
},
tabText: {
fontFamily: "Quicksand-SB",
},
});