-
Notifications
You must be signed in to change notification settings - Fork 52
/
App.tsx
51 lines (45 loc) · 1.23 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
46
47
48
49
50
51
import { MaterialIcons } from '@expo/vector-icons';
import { DefaultTheme } from '@react-navigation/native';
import * as Font from 'expo-font';
import * as Linking from 'expo-linking';
import * as SplashScreen from 'expo-splash-screen';
import { StatusBar } from 'expo-status-bar';
import React, { useEffect } from 'react';
import 'react-native-gesture-handler';
import Navigation from './src/components/Navigation';
SplashScreen.preventAutoHideAsync();
const theme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
primary: '#000',
},
};
export default function App() {
const [fontsLoaded, setFontsLoaded] = React.useState(false);
useEffect(() => {
Font.loadAsync({
'Montserrat': require('./assets/fonts/Montserrat.otf'),
'Montserrat-SemiBold': require('./assets/fonts/Montserrat-SemiBold.otf'),
...MaterialIcons.font,
})
.finally(() => setFontsLoaded(true))
.catch(() => {});
}, []);
if (!fontsLoaded) {
return null;
}
return (
<>
<StatusBar translucent />
<Navigation
theme={theme}
onReady={() => SplashScreen.hideAsync()}
linking={{
prefixes: [Linking.createURL('/')],
enabled: 'auto',
}}
/>
</>
);
}