generated from flatlogic/react-native-starter
/
App.js
52 lines (48 loc) · 1.54 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
import { NavigationContainer } from '@react-navigation/native';
import React from 'react';
import messaging from '@react-native-firebase/messaging';
import { ActivityIndicator, Platform, StyleSheet, UIManager, View } from 'react-native';
import { Provider as PaperProvider } from 'react-native-paper';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import Navigator from './src/containers/App';
import { persistor, store } from './src/store';
import { colors } from './src/styles';
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'white',
},
});
export default class App extends React.PureComponent {
componentDidMount() {
if (Platform.OS === 'android') {
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
}
messaging().setBackgroundMessageHandler(async () => {});
}
render() {
return (
<Provider store={store}>
<PaperProvider>
<NavigationContainer>
<PersistGate
loading={(
<View style={styles.container}>
<ActivityIndicator color={colors.red} />
</View>
)}
persistor={persistor}
>
<Navigator onNavigationStateChange={() => {}} uriPrefix="/app" />
</PersistGate>
</NavigationContainer>
</PaperProvider>
</Provider>
);
}
}