-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
62 lines (54 loc) · 1.76 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
58
59
60
61
62
import { NativeBaseProvider } from "native-base";
import { useEffect, useState } from 'react'
import { Routes } from "./src/routes";
import 'react-native-gesture-handler';
import {
useFonts,
Epilogue_400Regular,
Epilogue_600SemiBold,
Epilogue_700Bold,
} from "@expo-google-fonts/epilogue";
import { LinearGradient } from "expo-linear-gradient";
import { Loading } from "@components/Loading";
import { THEME } from "./src/theme";
import { Splash } from "@components/Splash";
import { preventAutoHideAsync } from 'expo-splash-screen'
import { GoalsContextProvider } from "@contexts/HabitsContext";
import { TimerControlProvider } from "@contexts/TimerControlContext";
import { AuthContextProvider } from "@contexts/AuthContext";
import { NotificationContextProvider } from "@contexts/NotificationsContext";
import { useNotification } from "@hooks/useNotification";
preventAutoHideAsync();
export default function App() {
const [splashComplete, setSplashComplete] = useState(false)
const [fontsLoaded] = useFonts({
Epilogue_400Regular,
Epilogue_700Bold,
Epilogue_600SemiBold,
});
const config = {
dependencies: {
"linear-gradient": LinearGradient,
},
};
return (
<NativeBaseProvider theme={THEME} config={config}>
{splashComplete
? fontsLoaded
? (
<NotificationContextProvider>
<AuthContextProvider>
<GoalsContextProvider>
<TimerControlProvider>
<Routes />
</TimerControlProvider>
</GoalsContextProvider>
</AuthContextProvider>
</NotificationContextProvider>
)
: <Loading />
: <Splash onComplete={setSplashComplete} />
}
</NativeBaseProvider>
);
}