-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
65 lines (59 loc) · 2.11 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
import "react-native-gesture-handler";
import { useEffect, useState } from "react";
import { useFonts } from "expo-font";
import { Loader } from "./components/Loader";
import { NavigationContainer } from "@react-navigation/native";
import Onboarding1 from "./screens/Onboarding1";
import Onboarding2 from "./screens/Onboarding2";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import Main from "./screens/Main";
import ProverbDetails from "./screens/ProverbDetails";
import { SearchProvider } from "./contexts/SearchContext";
import { HistoryProvider } from "./contexts/HistoryContext";
import { FavoritesProvider } from "./contexts/FavoriteContext";
const Stack = createNativeStackNavigator();
export default function App() {
let [fontLoaded] = useFonts({
"OpenSans-Bold": require("./assets/fonts/OpenSans-Bold.ttf"),
"OpenSans-Regular": require("./assets/fonts/OpenSans-Regular.ttf"),
"Raleway-Bold": require("./assets/fonts/Raleway-Bold.ttf"),
"Raleway-Regular": require("./assets/fonts/Raleway-Regular.ttf"),
});
const [loading, setLoading] = useState(true);
useEffect(() => {
setTimeout(() => {
setLoading(false);
}, 1500);
}, []);
if (!fontLoaded || loading) {
return <Loader />;
}
return (
<SearchProvider>
<HistoryProvider>
<FavoritesProvider>
<NavigationContainer>
<Stack.Navigator
initialRouteName="Onboarding1"
screenOptions={{ headerShown: false }}
>
<Stack.Screen
name="Onboarding1"
component={Onboarding1}
></Stack.Screen>
<Stack.Screen
name="Onboarding2"
component={Onboarding2}
></Stack.Screen>
<Stack.Screen name="Main" component={Main}></Stack.Screen>
<Stack.Screen
name="ProverbDetails"
component={ProverbDetails}
></Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
</FavoritesProvider>
</HistoryProvider>
</SearchProvider>
);
}