-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
34 lines (29 loc) · 995 Bytes
/
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
import React from 'react';
import { View, StatusBar, useColorScheme } from 'react-native';
import NewsStackNavigator from './src/routes/NewsStackNavigator';
import Splash from './src/components/Splash/Splash';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import { store, persistor } from './src/store';
import Colors from './src/utils/Colors';
const App = () => {
const [ready, setReady] = React.useState(false)
const isDarkMode = useColorScheme() === 'dark';
React.useEffect(() => {
setTimeout(() => setReady(true), 2000)
}, [])
return (
<>
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} backgroundColor={Colors.yellow} />
<Provider store={store}>
<PersistGate loading={<View />} persistor={persistor}>
{ready ?
<NewsStackNavigator />
:
<Splash />}
</PersistGate>
</Provider>
</>
);
};
export default App;