-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
63 lines (55 loc) · 1.57 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
55
56
57
58
59
60
61
62
63
import React, { useState } from 'react';
import {
Platform, StatusBar, View,
} from 'react-native';
import { useFonts } from 'expo-font';
import AppLoading from 'expo-app-loading';
import { Asset } from 'expo-asset';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import Store from './src/Store';
import Main from './src/Main';
import splash from './assets/splash.png';
import Book from './assets/Jost/Book.otf';
import BookItalic from './assets/Jost/BookItalic.otf';
import Medium from './assets/Jost/Medium.otf';
import MediumItalic from './assets/Jost/MediumItalic.otf';
import Semi from './assets/Jost/Semi.otf';
import SemiItalic from './assets/Jost/SemiItalic.otf';
import Bold from './assets/Jost/Bold.otf';
import BoldItalic from './assets/Jost/BoldItalic.otf';
const App = () => {
const [fontsLoaded] = useFonts({
Book,
BookItalic,
Medium,
MediumItalic,
Semi,
SemiItalic,
Bold,
BoldItalic,
});
const [isSplashReady, setSplashReady] = useState(false);
async function cacheSplashResourcesAsync() {
return Asset.fromModule(splash).downloadAsync();
}
if (!isSplashReady || !fontsLoaded) {
return (
<AppLoading
startAsync={() => cacheSplashResourcesAsync()}
onFinish={() => setSplashReady(true)}
onError={console.warn}
/>
);
}
return (
<View style={{ flex: 1 }}>
{Platform.OS === 'ios' && <StatusBar barStyle="dark-content" />}
<SafeAreaProvider>
<Store>
<Main />
</Store>
</SafeAreaProvider>
</View>
);
};
export default App;