-
Notifications
You must be signed in to change notification settings - Fork 16
/
App.js
61 lines (51 loc) · 1.78 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
import * as Font from 'expo-font';
import React, { Component } from 'react';
import { StatusBar } from 'react-native';
import { enableScreens } from 'react-native-screens';
import { createStore, applyMiddleware, compose } from 'redux';
import { Provider } from 'react-redux';
import * as storage from 'redux-storage';
import createEngine from 'redux-storage-engine-reactnativeasyncstorage';
import storageFilter from 'redux-storage-decorator-filter';
import thunk from 'redux-thunk';
import reducers from './reducers';
import Routes from './Routes';
// Error tracing
// TODO: replace with sentry-expo: https://docs.sentry.io/clients/react-native/expo/
// NativeModules.AppDelegate.getBundleVersion(function(version, build) {
// if (__DEV__) {
// return false;
// }
// ReactRaven(Raven);
// Raven.config('https://1da89ea4f2a948f881160b9ebb3c71d8@sentry.io/104708', {
// release: version + '-' + build,
// }).install();
// });
const engine = storageFilter( createEngine( 'my-save-keydd' ), [
'activeSite',
'sites',
] );
const storageMiddleware = storage.createMiddleware( engine );
const middleware = [ thunk, storageMiddleware ];
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const enhancer = composeEnhancers( applyMiddleware( ...middleware ) );
const store = createStore( storage.reducer( reducers ), enhancer );
const loadStorage = storage.createLoader( engine );
loadStorage( store ).then( state => {} );
StatusBar.setBarStyle( 'dark-content' );
// Enable react-native-screens for performance.
enableScreens();
export default class App extends Component {
componentDidMount() {
Font.loadAsync( {
'sfsymbols': require( './images/SFSymbolsFallback.ttf' ),
} );
}
render() {
return (
<Provider store={ store }>
<Routes />
</Provider>
);
}
}