-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
76 lines (67 loc) · 2.13 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import React from 'react';
import AppLoading from 'expo-app-loading';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { StatusBar } from 'expo-status-bar';
import { DefaultTheme, Provider as PaperProvider } from 'react-native-paper';
import * as Sentry from 'sentry-expo';
import GlobalStore from 'globalStore/GlobalStore';
import { Colors } from 'styles';
import ErrorSnackbarProvider from 'common/ErrorSnackbar/ErrorSnackbarProvider';
import ReactQueryClient from 'components/ReactQueryClient/ReactQueryClient';
import { Provider as ReduxProvider } from 'react-redux';
import { LogBox, Platform, UIManager } from 'react-native';
import { LocalizationProvider } from './localization';
import initStyles from './styles/init';
import RootNavigator from './navigation/RootNavigator';
import store from './globalStore/store';
LogBox.ignoreLogs(['Setting a timer']);
const theme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
primary: Colors.accent,
error: Colors.error,
disabled: Colors.separator,
placeholder: Colors.offBlack,
},
};
if (
Platform.OS === 'android' &&
UIManager.setLayoutAnimationEnabledExperimental
) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
function App() {
const ready = initStyles();
if (!ready) {
return <AppLoading />;
}
Sentry.init({
dsn: process.env.SENTRY_DSN,
enableInExpoDevelopment: true,
// enableNative: false,
debug: true, // TODO set to false in production
});
return (
<LocalizationProvider>
<GlobalStore>
<ReduxProvider store={store}>
<ErrorSnackbarProvider>
<ReactQueryClient>
<PaperProvider theme={theme}>
<SafeAreaProvider>
<StatusBar
// eslint-disable-next-line react/style-prop-object
style="dark"
/>
<RootNavigator />
</SafeAreaProvider>
</PaperProvider>
</ReactQueryClient>
</ErrorSnackbarProvider>
</ReduxProvider>
</GlobalStore>
</LocalizationProvider>
);
}
export default App;