-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
45 lines (38 loc) · 1.01 KB
/
App.tsx
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
import * as Font from "expo-font";
import Navigation from "./src/components/navigation/Navigation";
import { useEffect, useState } from "react";
import { Provider as PaperProvider } from "react-native-paper";
import { Provider } from "react-redux";
import { store } from "./src/redux/store";
import { LogBox } from "react-native";
LogBox.ignoreAllLogs();
const getFonts = () =>
Font.loadAsync({
"averiaLibre-regular": require("./assets/fonts/AveriaLibre-Regular.ttf"),
});
export default function App() {
const [fontsLoaded, setFontsLoaded] = useState(false);
useEffect(() => {
async function prepare() {
try {
await getFonts();
await new Promise((resolve) => setTimeout(resolve, 2000));
} catch (e) {
console.warn(e);
} finally {
setFontsLoaded(true);
}
}
prepare();
}, []);
if (!fontsLoaded) {
return null;
}
return (
<Provider store={store}>
<PaperProvider>
<Navigation />
</PaperProvider>
</Provider>
);
}