-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathApp.tsx
More file actions
49 lines (43 loc) · 1.51 KB
/
App.tsx
File metadata and controls
49 lines (43 loc) · 1.51 KB
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
/* eslint-disable react-native/no-inline-styles */
import { DSN_KEY } from '@env';
import AsyncStorage from '@react-native-async-storage/async-storage';
import * as Sentry from '@sentry/react-native';
import React, { Component } from 'react';
import { StatusBar } from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { Provider } from 'react-redux';
import { applyMiddleware, createStore } from 'redux';
import { persistReducer, persistStore } from 'redux-persist';
import { PersistGate } from 'redux-persist/integration/react';
import createSagaMiddleware from 'redux-saga';
import Main from './src/Main';
import rootReducer from './src/redux/reducers';
import watchers from './src/redux/sagas';
const persistConfig = {
key: 'root',
storage: AsyncStorage,
whitelist: ['settingsReducer']
};
const persistedReducer = persistReducer(persistConfig, rootReducer);
const saga = createSagaMiddleware();
export const store = createStore(persistedReducer, applyMiddleware(saga));
export const persistor = persistStore(store);
saga.run(watchers);
Sentry.init({
dsn: DSN_KEY
});
export class App extends Component {
render() {
return (
<Provider store={store}>
<GestureHandlerRootView style={{ flex: 1 }}>
<PersistGate loading={null} persistor={persistor}>
<StatusBar hidden={false} barStyle="light-content" />
<Main />
</PersistGate>
</GestureHandlerRootView>
</Provider>
);
}
}
export default Sentry.wrap(App);