-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.tsx
57 lines (51 loc) · 1.45 KB
/
App.tsx
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
import 'expo-dev-client';
import * as SystemUI from 'expo-system-ui';
import {
OpenSans_300Light,
OpenSans_400Regular,
OpenSans_500Medium,
OpenSans_600SemiBold,
OpenSans_700Bold,
OpenSans_800ExtraBold,
useFonts,
} from '@expo-google-fonts/open-sans';
import { NavigationContainer } from '@react-navigation/native';
import { StatusBar } from 'expo-status-bar';
import { useEffect } from 'react';
import colors from 'tailwindcss/colors';
import { Loading } from './src/components/Loading';
import { ExercisesProvider } from './src/contexts/Exercises';
import { FirebaseAuthProvider } from './src/contexts/FirebaseAuth';
import { TrainingProvider } from './src/contexts/Trainings/Trainings';
import Routes from './src/routes';
export default function App() {
const [fontsLoaded] = useFonts({
OpenSans_300Light,
OpenSans_400Regular,
OpenSans_500Medium,
OpenSans_600SemiBold,
OpenSans_700Bold,
OpenSans_800ExtraBold,
});
async function SetBackgroundColor() {
await SystemUI.setBackgroundColorAsync(colors.yellow[400]);
}
useEffect(() => {
SetBackgroundColor();
}, []);
if (!fontsLoaded) {
return <Loading />;
}
return (
<NavigationContainer>
<FirebaseAuthProvider>
<ExercisesProvider>
<TrainingProvider>
<StatusBar style="dark" />
<Routes />
</TrainingProvider>
</ExercisesProvider>
</FirebaseAuthProvider>
</NavigationContainer>
);
}