-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
53 lines (48 loc) · 1.58 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
import "react-native-gesture-handler";
import AppLoading from "expo-app-loading";
import { StatusBar } from "expo-status-bar";
import React, { useState } from "react";
import * as Font from "expo-font";
import { NavigationContainer } from "@react-navigation/native";
import { Provider } from "react-redux";
import MainNavigator from "./routes/MainNavigator";
import store from "./redux/store";
import ErrorAlertModal from "./components/modals/ErrorAlertModal";
// import { useScreens } from "react-native-screens";
// useScreens();
const fetchFonts = () => {
return Font.loadAsync({
"roboto-light": require("./assets/fonts/Roboto-Light.ttf"),
"roboto-regular": require("./assets/fonts/Roboto-Regular.ttf"),
"roboto-medium": require("./assets/fonts/Roboto-Medium.ttf"),
"roboto-bold": require("./assets/fonts/Roboto-Bold.ttf"),
"roboto-black": require("./assets/fonts/Roboto-Black.ttf"),
"comfortaa-bold": require("./assets/fonts/Comfortaa-Bold.ttf"),
fonarto: require("./assets/fonts/Fonarto.ttf"),
});
};
export default function App() {
const [dataLoaded, setDataLoaded] = useState(false);
if (!dataLoaded) {
return (
<AppLoading
startAsync={fetchFonts}
onFinish={() => setDataLoaded(true)}
onError={(err) =>
ErrorAlertModal(
"Couldn't load the app. Please try again later...",
err
)
}
/>
);
}
return (
<Provider store={store}>
<NavigationContainer>
<MainNavigator />
<StatusBar style="auto" />
</NavigationContainer>
</Provider>
);
}