-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
41 lines (37 loc) · 1.25 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
import React, { FC } from 'react';
import { StatusBar, Platform, UIManager } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import SplashScreen from 'react-native-splash-screen';
import { ThemeProvider } from 'styled-components/native';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import Navigator from './src';
import { store, persistor } from '@store';
import { COLORS, THEME } from '@constants';
if (
Platform.OS === 'android' &&
UIManager.setLayoutAnimationEnabledExperimental
)
UIManager.setLayoutAnimationEnabledExperimental(true);
const App: FC = () => {
return (
<>
<StatusBar backgroundColor={COLORS.white} barStyle="dark-content" />
<NavigationContainer>
<Provider store={store}>
<PersistGate persistor={persistor}>
{(bootstrapped) => {
if (bootstrapped) SplashScreen.hide(); // if redux-persist finished loading, then render app
return (
<ThemeProvider theme={THEME}>
<Navigator />
</ThemeProvider>
);
}}
</PersistGate>
</Provider>
</NavigationContainer>
</>
);
};
export default App;