-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
47 lines (42 loc) · 1.2 KB
/
App.tsx
File metadata and controls
47 lines (42 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
44
45
46
47
import React, { useEffect, useState } from 'react';
import * as Font from 'expo-font';
import {
Poppins_600SemiBold, Poppins_500Medium, Poppins_400Regular,
} from '@expo-google-fonts/poppins';
import {
DMSans_500Medium, DMSans_400Regular, DMSans_700Bold,
} from '@expo-google-fonts/dm-sans';
import { NavigationContainer } from '@react-navigation/native';
import Stack from './src/pages/Navigation';
import { UserProvider } from './src/contexts/UserContextDispatch';
import { GroupsProvider } from './src/contexts/GroupsContextDispatch';
import { View } from 'react-native';
export default function App(): JSX.Element {
const [loadedFonts, setLoadedFonts] = useState(false);
async function loadFonts() {
await Font.loadAsync({
Poppins_500Medium,
Poppins_600SemiBold,
Poppins_400Regular,
DMSans_500Medium,
DMSans_400Regular,
DMSans_700Bold,
});
setLoadedFonts(true);
}
useEffect(() => {
void loadFonts();
}, []);
if (loadedFonts) {
return (
<NavigationContainer>
<UserProvider>
<GroupsProvider>
<Stack />
</GroupsProvider>
</UserProvider>
</NavigationContainer>
);
}
return <View />;
}