-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
51 lines (48 loc) · 1.38 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
import React, {useState, useEffect} from 'react';
import { View, Text, StyleSheet } from "react-native";
import Candidat from './screens/Accueil/Candidat';
import * as Font from 'expo-font';
import RegisterUser from './screens/Auth/RegisterUser';
import Login from './screens/Auth/LoginUser';
import Filtrer from './screens/Filtrer';
import Navigator from './routes/HomeStack';
const App = () => {
const [loading, setLoading] = useState(true);
const LoadFont = async () => {
try {
await Font.loadAsync({
"Gilroy": require("./assets/fonts/Gilroy-Bold.ttf"),
"GT-Sectra-Fine-Regular": require("./assets/fonts/GT-Sectra-Fine-Regular.ttf"),
"Montserrat-Black": require("./assets/fonts/Montserrat-Black.ttf"),
"Montserrat-Medium": require("./assets/fonts/Montserrat-Medium.ttf"),
"Montserrat-SemiBold": require("./assets/fonts/Montserrat-SemiBold.ttf")
});
setLoading(false);
} catch (e) {
console.error('erreur', e);
}
}
useEffect(() => {
LoadFont();
},[]);
if(loading) {
return (
<View style={styles.container}>
<Text>Loading...</Text>
</View>
)
}
return (
<Navigator />
);
};
const styles = StyleSheet.create({
container: {
flex: 1, //important
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
marginTop: 20
}
});
export default App;