-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
45 lines (39 loc) · 1.48 KB
/
App.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
import { ActivityIndicator, StatusBar, View} from 'react-native';
import { Amplify } from 'aws-amplify';
import awsExports from './src/aws-exports';
import { SafeAreaProvider } from "react-native-safe-area-context/src/SafeAreaContext";
import * as Font from "expo-font";
import FavoriteListProvider from './src/contexts/FavoriteListContext';
import Navigation from './src/screens/navigation/Navigation';
import { useEffect, useState } from "react";
Amplify.configure(awsExports);
export default function App() {
const [fontsLoaded, setFontsLoaded] = useState(false);
const fetchFonts = async () => {
await Font.loadAsync({
"Montserrat-Italic-VariableFont": require("./assets/fonts/Montserrat-Italic-VariableFont.ttf"),
"Montserrat-Medium": require("./assets/fonts/Montserrat-Medium.ttf"),
"Montserrat-Regular": require("./assets/fonts/Montserrat-Regular.ttf"),
"Montserrat-SemiBold": require("./assets/fonts/Montserrat-SemiBold.ttf")
});
};
useEffect(() => {
fetchFonts();
setFontsLoaded(true)
}, [])
if (!fontsLoaded) {
return (
<View style={{flex: 1, justifyContent: 'center'}}>
<ActivityIndicator size={'large'} color={'#d9202e'}/>
</View>
);
}
return (
<SafeAreaProvider>
<StatusBar/>
<FavoriteListProvider>
<Navigation/>
</FavoriteListProvider>
</SafeAreaProvider>
);
}