forked from mohanadarafe/GuideMe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
37 lines (32 loc) · 952 Bytes
/
App.js
File metadata and controls
37 lines (32 loc) · 952 Bytes
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
import React from "react";
import Navigator from "./routes/drawer";
import { AppLoading } from "expo";
import * as Font from "expo-font";
import { retrieveApiKey } from "./services/getApiKey";
import { Provider } from "react-redux";
import { store } from "./redux/reducers/index"
//Navigator is an alias, we can give it any name we want, since it is a default export.
export default function App () {
console.disableYellowBox = true;
const [isReady, setIsReady] = React.useState(false);
const getFonts = () => {
return Font.loadAsync({
"encodeSansExpanded": require("./assets/fonts/EncodeSansExpanded-Regular.ttf")
});
};
retrieveApiKey(); //Retrieving ApiKey on App startup.
if (!isReady) {
return (
<AppLoading
startAsync={getFonts}
onFinish={() => setIsReady(true)}
/>
);
} else {
return (
<Provider store={store}>
<Navigator />
</Provider>
);
}
}