-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathApp.tsx
34 lines (26 loc) · 1007 Bytes
/
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
import 'localization';
import React, { useState } from 'react';
import { StatusBar } from 'react-native';
import { NavigationContainer, useTheme } from '@react-navigation/native';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import AnimatedBootSplash from 'common/AnimatedSplash';
import NavigationStack from 'navigation';
import { useThemeConfig } from 'themes/useThemeConfig';
const client = new QueryClient();
const App: () => React.JSX.Element = () => {
const { theme } = useThemeConfig();
const { dark: isDarkMode } = useTheme();
const [visible, setVisible] = useState(true);
if (visible) {
return <AnimatedBootSplash onAnimationEnd={() => setVisible(false)} />;
}
return (
<QueryClientProvider client={client}>
<NavigationContainer theme={theme}>
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
<NavigationStack />
</NavigationContainer>
</QueryClientProvider>
);
};
export default App;