-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.js
54 lines (47 loc) · 1.29 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
52
53
54
import React, { useEffect } from 'react'
import { StyleSheet, View, LogBox } from 'react-native'
import AppLoading from 'expo-app-loading'
import { useFonts } from 'expo-font'
import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context'
import AppNavigator from './navigation/AppNavigator'
import { ContextProvider } from './Context'
import Colors from './constants/Colors'
export default function App(props) {
let [fontsLoaded] = useFonts({
Aldrich_400Regular: require('./assets/fonts/Aldrich-Regular.ttf'),
NovaMono_400Regular: require('./assets/fonts/NovaMono.ttf'),
fonticons: require('./assets/fonts/fonticons.ttf'),
})
useEffect(() => {
LogBox.ignoreLogs(['Animated: `useNativeDriver`'])
}, [])
if (fontsLoaded) {
return (
<SafeAreaProvider style={styles.container}>
<UnsafeTopArea />
<ContextProvider>
<AppNavigator />
</ContextProvider>
</SafeAreaProvider>
)
} else {
return <AppLoading />
}
}
function UnsafeTopArea(props) {
const insets = useSafeAreaInsets()
return (
<View
style={{
backgroundColor: Colors.passiveBG,
paddingTop: insets.top,
}}
/>
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
},
})