-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathApp.js
137 lines (129 loc) · 3.65 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import { Image } from "react-native";
import { useFonts } from "expo-font";
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { createStackNavigator } from "@react-navigation/stack";
import WordControlProvider from "./src/context";
import ExercisePage from "./src/pages/ExercisePage";
import CountrySelect from "./src/pages/CountrySelect";
const Stack = createStackNavigator();
import Home from "./src/pages/Home";
import Dialog from "./src/pages/Dialog";
import Profile from "./src/pages/Profile";
const Tab = createBottomTabNavigator();
export default function App() {
const [loaded] = useFonts({
Nunito_Black: require("./assets/Fonts/Nunito-Black.ttf"),
Nunito_Bold: require("./assets/Fonts/Nunito-Bold.ttf"),
Nunito_ExtraBold: require("./assets/Fonts/Nunito-ExtraBold.ttf"),
Nunito_Regular: require("./assets/Fonts/Nunito-Regular.ttf"),
});
if (!loaded) {
return null;
}
return (
<WordControlProvider>
<NavigationContainer independent={true}>
<HomePage />
</NavigationContainer>
</WordControlProvider>
);
}
function HomePage() {
return (
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="BottomNavigator" component={BottomNavigator} />
<Stack.Screen
name="ExercisePage"
component={ExercisePage}
options={{
presentation: "modal",
}}
/>
<Stack.Screen
name="CountrySelect"
component={CountrySelect}
options={{
presentation: "modal",
}}
/>
</Stack.Navigator>
);
}
function BottomNavigator() {
return (
<Tab.Navigator
screenOptions={{ tabBarShowLabel: false, headerShown: false }}
>
<Tab.Screen
name="Home"
component={Home}
options={{
tabBarIcon: ({ focused }) => {
if (focused) {
return (
<Image
style={{ width: 30, height: 25 }}
source={require("./assets/Icons/home-active.png")}
/>
);
} else {
return (
<Image
style={{ width: 30, height: 25 }}
source={require("./assets/Icons/home-unactive.png")}
/>
);
}
},
}}
/>
<Tab.Screen
name="Dialog"
component={Dialog}
options={{
tabBarIcon: ({ focused }) => {
if (focused) {
return (
<Image
style={{ width: 30, height: 24 }}
source={require("./assets/Icons/book-active.png")}
/>
);
} else {
return (
<Image
style={{ width: 30, height: 24 }}
source={require("./assets/Icons/book-unactive.png")}
/>
);
}
},
}}
/>
<Tab.Screen
name="Profile"
component={Profile}
options={{
tabBarIcon: ({ focused }) => {
if (focused) {
return (
<Image
style={{ width: 30, height: 25 }}
source={require("./assets/Icons/profile-active.png")}
/>
);
} else {
return (
<Image
style={{ width: 30, height: 25 }}
source={require("./assets/Icons/profile-unactive.png")}
/>
);
}
},
}}
/>
</Tab.Navigator>
);
}