-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathApp.js
More file actions
43 lines (36 loc) · 1.2 KB
/
App.js
File metadata and controls
43 lines (36 loc) · 1.2 KB
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
import React, { useCallback} from "react"; // react library
import { Provider } from 'react-redux'
import * as SplashScreen from "expo-splash-screen";
import { useFonts, loadAsync } from "expo-font";
import store from './src/app/store'
import { decode, encode } from "base-64";
import AppNavigation from "./src/navigation/AppNavigation"; // for the decode and encode of the text
if (!global.btoa) {
global.btoa = encode;
} // encodes to Base64
if (!global.atob) {
global.atob = decode;
} // decodes from Base64
SplashScreen.preventAutoHideAsync();
export default function App() {
// Import custom fonts
const [fontsLoaded] = useFonts({
'Montserrat_400Regular': require ('./assets/fonts/Montserrat_400Regular.ttf'),
'Montserrat_900Black': require ('./assets/fonts/Montserrat_900Black.ttf'),
'Whitney-Medium': require('./assets/fonts/Whitney-Medium.ttf')
});
const onLayoutRootView = useCallback(async () => {
if (fontsLoaded) {
await SplashScreen.hideAsync();
}
}, [fontsLoaded]);
if (!fontsLoaded) {
return null;
}
// Routes & Navigation of different screens
return (
<Provider store={store}>
<AppNavigation onReady={onLayoutRootView}/>
</Provider>
);
}