-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
35 lines (31 loc) · 1.12 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
// App.js
import 'react-native-gesture-handler';
import React, { useEffect } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import * as SplashScreen from "expo-splash-screen";
import { SafeAreaView } from 'react-native-safe-area-context';
import { ThemeProvider } from './models/ThemeContext'; // Import ThemeProvider
import MainNavigator from './navigation/MainNavigator'; // Import the separated MainNavigator
// Prevent the splash screen from auto-hiding
SplashScreen.preventAutoHideAsync();
export default function App() {
useEffect(() => {
const hideSplashScreen = async () => {
await new Promise((resolve) => setTimeout(resolve, 2000));
await SplashScreen.hideAsync();
};
hideSplashScreen();
}, []);
return (
<ThemeProvider>
<SafeAreaView style={{ flex: 1 }}>
<GestureHandlerRootView style={{ flex: 1 }}>
<NavigationContainer>
<MainNavigator />
</NavigationContainer>
</GestureHandlerRootView>
</SafeAreaView>
</ThemeProvider>
);
}