-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
39 lines (33 loc) · 1.06 KB
/
Copy pathApp.tsx
File metadata and controls
39 lines (33 loc) · 1.06 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
import React, { useState, useCallback } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { StatusBar } from 'react-native';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import BottomNavigation from './Components/BottomNavigation';
import SplashScreen from './screens/SplashScreen';
const queryClient = new QueryClient();
const App = () => {
const [showSplash, setShowSplash] = useState(true);
const handleSplashFinish = useCallback(() => {
setShowSplash(false);
}, []);
if (showSplash) {
return (
<>
<StatusBar barStyle="light-content" />
<SplashScreen onFinish={handleSplashFinish} />
</>
);
}
return (
<QueryClientProvider client={queryClient}>
<SafeAreaProvider>
<NavigationContainer>
<StatusBar barStyle="light-content" />
<BottomNavigation />
</NavigationContainer>
</SafeAreaProvider>
</QueryClientProvider>
);
};
export default App;