-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
35 lines (27 loc) · 911 Bytes
/
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
import React, {useState} from 'react';
import { StyleSheet, Platform, StatusBar, View, Text, Alert } from 'react-native';
import AppLoading from 'expo-app-loading';
import * as Font from 'expo-font';
import { AppNavigator } from "./app/assets/routes/AppNavigator"
const getFonts = () => Font.loadAsync({
'ubuntu-regular': require('./app/assets/fonts/Ubuntu-Bold.ttf'),
'ubuntu-bold': require('./app/assets/fonts/Ubuntu-Regular.ttf'),
'ubuntu-light': require('./app/assets/fonts/Ubuntu-Light.ttf'),
});
export default function App() {
const [fontsLoaded, setFontsLoaded] = useState(false);
if (fontsLoaded) {
return (
<AppNavigator/>
)
}
else {
return (
<AppLoading
startAsync={getFonts}
onError={(text) => Alert.alert('Échec du chargement :(', String(text), [{text: 'Ok'}])}
onFinish={() => {setFontsLoaded(true)}}
/>
)
}
}