-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathApp.js
49 lines (45 loc) · 1.67 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
46
47
48
49
import React, { useState } from "react";
import { Platform, StatusBar, View } from "react-native";
import { SafeAreaView, SafeAreaProvider } from "react-native-safe-area-context";
import { NavigationContainer } from "@react-navigation/native";
import HomeStackNavigator from "./src/navigation/stack/HomeStackNavigator";
import { PlayerConfigProvider } from "./src/states/playerConfigContext";
import { PlantDataProvider } from "./src/states/plantsDataContext";
import { CompletedLevelsProvider } from "./src/states/completedLevelsContext";
import { SpeciesProgressContext, SpeciesProgressProvider } from "./src/states/speciesProgressContext";
import LoadingScreen from "./src/screens/LoadingScreen"; // Update the path
const App = () => {
const [isLoading, setIsLoading] = useState(true);
const handleFinishLoading = () => {
setIsLoading(false);
};
return (
<SafeAreaProvider>
<SafeAreaView
style={{
flex: 1,
backgroundColor: "black",
}}
edges={["right", "left"]}
>
<StatusBar setHidden={true} />
<PlayerConfigProvider>
<PlantDataProvider>
<SpeciesProgressProvider>
<CompletedLevelsProvider>
{isLoading ? (
<LoadingScreen onFinishLoading={handleFinishLoading} />
) : (
<NavigationContainer>
<HomeStackNavigator />
</NavigationContainer>
)}
</CompletedLevelsProvider>
</SpeciesProgressProvider>
</PlantDataProvider>
</PlayerConfigProvider>
</SafeAreaView>
</SafeAreaProvider>
);
};
export default App;