-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.js
57 lines (49 loc) · 1.81 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
/**
* @format
* The entry point for the AccessMap Application.
*/
import React from "react";
import { AppRegistry } from "react-native";
//-------------------------------------------------------------------------------------------------
// https://github.com/software-mansion/react-native-gesture-handler/issues/320
import "react-native-gesture-handler";
import "./i18n";
//-------------------------------------------------------------------------------------------------
// Redux
import { createStore, applyMiddleware } from "redux";
import rootReducer from "./src/reducers";
import { Provider } from "react-redux";
import thunkMiddleware from "redux-thunk";
import { persistStore, persistReducer } from "redux-persist";
import { PersistGate } from "redux-persist/integration/react";
import AsyncStorage from "@react-native-async-storage/async-storage";
//-------------------------------------------------------------------------------------------------
import App from "./src/App";
import { name as appName } from "./app.json";
import { ReactNativeKeycloakProvider } from "@react-keycloak/native";
import keycloak from "./src/keycloak";
const persistConfig = {
key: "root",
storage: AsyncStorage,
};
const persistedReducer = persistReducer(persistConfig, rootReducer);
export const store = createStore(
persistedReducer,
applyMiddleware(thunkMiddleware)
);
const persister = persistStore(store);
const Index = () => (
<ReactNativeKeycloakProvider
authClient={keycloak}
initOptions={{
redirectUri: "com.accessmap://home",
}}
>
<Provider store={store}>
<PersistGate loading={null} persistor={persister}>
<App />
</PersistGate>
</Provider>
</ReactNativeKeycloakProvider>
);
AppRegistry.registerComponent(appName, () => Index);