-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
55 lines (45 loc) · 1.34 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
import React from 'react';
import {StatusBar} from 'react-native';
import {useScreens} from 'react-native-screens'
import {persistor, store} from 'app/services/store';
import Navigation from 'app/services/navigation';
import {Provider} from 'react-redux';
import {PersistGate} from 'redux-persist/integration/react';
import I18n from 'app/services/I18n';
import Splash from "app/components/Splash";
I18n.setLocale("ar");
useScreens();
class App extends React.Component {
state = {
ready: false
};
boot() {
return new Promise(resolve => {
resolve();
});
}
render() {
if (!this.state.ready) {
return (
<Provider store={store}>
<PersistGate persistor={persistor}>
<Splash
startAsync={this.boot}
onFinish={() => this.setState({ready: true})}
onError={(error => console.warn(error))}
/>
</PersistGate>
</Provider>
);
}
return (
<Provider store={store}>
<PersistGate persistor={persistor}>
<StatusBar barStyle="light-content"/>
<Navigation/>
</PersistGate>
</Provider>
);
}
}
export default App;