-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
74 lines (63 loc) · 2.63 KB
/
App.tsx
File metadata and controls
74 lines (63 loc) · 2.63 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import React, { useContext, useEffect } from 'react';
import { StatusBar, setStatusBarStyle } from 'expo-status-bar';
import { NavigationContainer } from '@react-navigation/native';
import { useFonts } from 'expo-font';
import { Provider as AuthProvider } from './src/contexts/AuthContext';
import { Provider as PreacherProvider } from './src/contexts/PreachersContext';
import { Provider as TerritoryProvider } from './src/contexts/TerritoriesContext';
import { Provider as MinistryGroupProvider } from './src/contexts/MinistryGroupContext';
import { navigationRef } from './src/RootNavigation';
import SwitchNavigator from './src/navigators/SwitchNavigator';
import { Provider as SettingsProvider } from './src/contexts/SettingsContext';
import * as Updates from 'expo-updates';
import FlashMessage from 'react-native-flash-message';
setStatusBarStyle('light')
const App = () => {
const [fontsLoaded] = useFonts({
'FontAwesome': require('./assets/fonts/FontAwesome.ttf'),
'InterThin': require('./assets/fonts/inter/Inter-Thin.ttf'),
'InterRegular': require('./assets/fonts/inter/Inter-Regular.ttf'),
'InterSemiBold': require('./assets/fonts/inter/Inter-SemiBold.ttf'),
'MontserratRegular': require('./assets/fonts/montserrat/Montserrat-Regular.ttf'),
'MontserratSemiBold': require('./assets/fonts/montserrat/Montserrat-SemiBold.ttf'),
'PoppinsThin': require('./assets/fonts/Poppins/Poppins-Thin.ttf'),
'PoppinsSemiBold': require('./assets/fonts/Poppins/Poppins-SemiBold.ttf'),
'PoppinsRegular': require('./assets/fonts/Poppins/Poppins-Regular.ttf')
});
// Uncomment when Expo updates will be working correctly on Samsung
/* async function onFetchUpdateAsync() {
try {
const update = await Updates.checkForUpdateAsync();
if (update.isAvailable) {
await Updates.fetchUpdateAsync();
await Updates.reloadAsync();
}
} catch (error) {
// You can also add an alert() to see the error message in case of an error when fetching updates.
alert(`Error fetching latest Expo update: ${error}`);
}
}
useEffect(() => {
onFetchUpdateAsync()
}, []) */
if(!fontsLoaded) {
return null;
}
return (
<AuthProvider>
<SettingsProvider>
<PreacherProvider>
<TerritoryProvider>
<MinistryGroupProvider>
<NavigationContainer ref={navigationRef}>
<SwitchNavigator />
</NavigationContainer>
</MinistryGroupProvider>
</TerritoryProvider>
</PreacherProvider>
</SettingsProvider>
<FlashMessage position={'bottom'} />
</AuthProvider>
)
}
export default App;