-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
55 lines (51 loc) · 1.83 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import { ThemeProvider } from 'react-native-elements';
import Toast from 'react-native-toast-message';
import ErrorBoundary from './components/ErrorBoundary';
import LoadingIndicator from './components/LoadingIndicator';
import Navigation from './navigation';
import { persistor, store } from './modules/store';
import Theme from './constants/Theme';
export default function App() {
const renderApp = (hydrated: boolean) => {
if (hydrated) {
return (
<ErrorBoundary location={`App Level`}>
<GestureHandlerRootView style={styles.container}>
<Navigation />
<StatusBar />
<Toast position={'bottom'} />
</GestureHandlerRootView>
</ErrorBoundary>
);
}
return (
<View>
<LoadingIndicator />
</View>
);
};
return (
<SafeAreaProvider>
<Provider store={store}>
<ThemeProvider theme={Theme} useDark={false}>
<PersistGate
loading={null}
persistor={persistor}
// @ts-ignore
children={(hydrated: boolean) => renderApp(hydrated)}
/>
</ThemeProvider>
</Provider>
</SafeAreaProvider>
);
}
const styles = StyleSheet.create({
container: { flex: 1 },
});