forked from zzorba/ArkhamCards
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
62 lines (55 loc) · 1.6 KB
/
index.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
import React from 'react';
import { AppearanceProvider, Appearance } from 'react-native-appearance';
import { ThemeProvider } from 'react-native-elements';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react'
import { Navigation } from 'react-native-navigation';
import 'reflect-metadata';
import DatabaseProvider from './src/data/DatabaseProvider';
import { registerScreens } from './src/app/screens';
import configureStore from './src/app/store';
import App from './src/app/App';
const theme = {
Button: {
raised: true,
disabledTitleStyle: {
color: '#444444',
},
disabledStyle: {
backgroundColor: '#dddddd',
},
},
};
const darkTheme = {
Button: {
raised: true,
disabledTitleStyle: {
color: '#bbbbbb',
},
disabledStyle: {
backgroundColor: '#111111',
},
},
};
function MyProvider({ store: { redux, persistor }, children}) {
return (
<AppearanceProvider>
<Provider store={redux}>
<PersistGate loading={null} persistor={persistor}>
<DatabaseProvider>
<ThemeProvider theme={Appearance.getColorScheme() === 'dark' ? darkTheme : theme}>
{ children }
</ThemeProvider>
</DatabaseProvider>
</PersistGate>
</Provider>
</AppearanceProvider>
);
}
const { store, persistor } = configureStore({});
/* eslint-disable @typescript-eslint/no-unused-vars */
let app = null;
Navigation.events().registerAppLaunchedListener(() => {
registerScreens(MyProvider, { redux: store, persistor: persistor });
app = new App(store);
});