-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
44 lines (40 loc) · 1.44 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
import { StatusBar } from 'expo-status-bar';
import React, { useEffect, useState } from 'react';
import * as Font from 'expo-font';
import useTheme from './hooks/colorScheme';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import Navigation from './navigation';
import { View } from './components/Themed';
export default function App() {
const colorScheme = useTheme();
const [appLoaded, setAppLoaded] = useState(false);
useEffect(() => {
//initialize app then hide splashscreen
initApp();
}, [])
async function initApp() {
let customFonts = {
'Gilroy': require('./assets/fonts/gilroy/Gilroy-Regular.ttf'),
'Gilroy-medium': require('./assets/fonts/gilroy/Gilroy-Medium.ttf'),
'Gilroy-semibold': require('./assets/fonts/gilroy/Gilroy-Semibold.ttf'),
'Gilroy-bold': require('./assets/fonts/gilroy/Gilroy-Bold.ttf'),
'Inter': require('./assets/fonts/Inter/Inter-Regular.ttf'),
'Inter-medium': require('./assets/fonts/Inter/Inter-Medium.ttf'),
'Inter-semibold': require('./assets/fonts/Inter/Inter-SemiBold.ttf'),
'Inter-bold': require('./assets/fonts/Inter/Inter-Bold.ttf'),
};
// load fonts
await Font.loadAsync(customFonts);
setAppLoaded(true);
}
if (appLoaded) {
return (
<SafeAreaProvider>
<Navigation colorScheme={colorScheme} />
<StatusBar />
</SafeAreaProvider>
);
} else {
return (<View></View>);
}
}