-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.tsx
61 lines (53 loc) · 1.51 KB
/
App.tsx
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 React, { useState } from "react";
import { Router } from "./react-router";
import Routes from "./navigation/Routes";
import { AppLoading } from "expo";
import * as Font from "expo-font";
import { Ionicons } from "@expo/vector-icons";
import * as Linking from "expo-linking";
import { FhirProvider, FhirProviderProps } from "./smartmarkers-router";
import { serverUrl } from "./urls";
import { Provider } from "react-redux";
import { store } from "./store";
const App: React.FC = () => {
const [isReady, setIsReady] = useState(false);
React.useEffect(() => {
const loadAssets = async () => {
await Font.loadAsync({
Roboto: require("native-base/Fonts/Roboto.ttf"),
Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf"),
...Ionicons.font,
});
setIsReady(true);
};
loadAssets();
}, []);
if (!isReady) {
return <AppLoading />;
}
const redirectUri = Linking.makeUrl("auth-callback");
const iss = serverUrl;
const scope =
"openid fhirUser offline_access user/*.* patient/*.* launch/encounter launch/patient profile";
const settings: FhirProviderProps = {
client_id: "my_web_app",
scope,
iss,
redirectUri,
promisSettings: {
url: "https://mss.fsm.northwestern.edu/AC_API/2018-10/",
identifier: '',
token: '',
},
};
return (
<FhirProvider {...settings}>
<Provider store={store}>
<Router>
<Routes />
</Router>
</Provider>
</FhirProvider>
);
};
export default App;