-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
63 lines (58 loc) · 2.06 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
/* eslint-disable global-require */
import React, { useEffect, useState } from 'react';
import * as SplashScreen from 'expo-splash-screen';
import './src/config/firebase';
import './src/config/sentry';
import { useFonts } from '@use-expo/font';
import { SafeAreaView, StatusBar } from 'react-native';
import { ReduxNetworkProvider } from 'react-native-offline';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import AppNavigator from './src';
import { colors, layout } from './src/styles';
import { store, persistor } from './src/store';
const style = {
container: {
flex: 1,
backgroundColor: colors.white,
},
};
// eslint-disable-next-line no-console
console.ignoredYellowBox = ['Setting a timer'];
export default function App() {
const [slashLoaded, setSlashLoaded] = useState(false);
const [fontsLoaded] = useFonts({
'Lora-Bold': require('./assets/fonts/Lora-Bold.ttf'),
'Lora-Italic': require('./assets/fonts/Lora-Italic.ttf'),
'Lora-Regular': require('./assets/fonts/Lora-Regular.ttf'),
'Roboto-Black': require('./assets/fonts/Roboto-Black.ttf'),
'Roboto-Bold': require('./assets/fonts/Roboto-Bold.ttf'),
'Roboto-Italic': require('./assets/fonts/Roboto-Italic.ttf'),
'Roboto-Light': require('./assets/fonts/Roboto-Light.ttf'),
'Roboto-Medium': require('./assets/fonts/Roboto-Medium.ttf'),
'Roboto-Regular': require('./assets/fonts/Roboto-Regular.ttf'),
});
useEffect(() => {
(async () => {
await SplashScreen.preventAutoHideAsync();
await SplashScreen.hideAsync();
setSlashLoaded(true);
})();
}, []);
if (!fontsLoaded && !slashLoaded) {
return null;
}
persistor.purge();
return (
<SafeAreaView style={style.container}>
<StatusBar barStyle={layout.isiOS ? 'dark-content' : 'default'} />
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<ReduxNetworkProvider>
<AppNavigator />
</ReduxNetworkProvider>
</PersistGate>
</Provider>
</SafeAreaView>
);
}