-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
72 lines (66 loc) · 2.58 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
63
64
65
66
67
68
69
70
71
72
import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
import {NotificationProvider} from './src/Providers/NotificationProvider';
import {AuthProvider} from './src/Providers/AuthProvider';
import {InternetConnectionProvider} from './src/Providers/InternetConnectionProvider';
import {OrientationProvider} from './src/Providers/OrientationContext';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import React, {useEffect} from 'react';
import {CompanyProvider} from './src/Providers/CompanyProvider';
import {DOXLEThemeProvider} from './src/Providers/DoxleThemeProvider/DoxleThemeProvider';
import {EventProvider} from 'react-native-outside-press';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
import {UserProvider} from './src/Providers/UserProvider';
import {VibrationProvider} from './src/Providers/VibrationProvider';
import {enableFreeze} from 'react-native-screens';
import {registerTranslation, en as PaperEn} from 'react-native-paper-dates';
registerTranslation('en', PaperEn);
import SplashScreen from 'react-native-splash-screen';
import RootAppRouting from './src/AppRoutes/AppRoutes';
enableFreeze(true);
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 2 * (60 * 1000), // 2 mins
gcTime: 5 * (60 * 1000), // 5 mins
retryDelay: 3 * 1000, // 3 seconds,
},
},
});
function App(): React.JSX.Element {
useEffect(() => {
// AsyncStorage.clear();
// queryClient.clear();
const timeout = setTimeout(() => {
SplashScreen.hide();
}, 1400);
return () => clearTimeout(timeout);
}, []);
return (
<QueryClientProvider client={queryClient}>
<SafeAreaProvider>
<OrientationProvider>
<DOXLEThemeProvider>
<NotificationProvider>
<InternetConnectionProvider>
<VibrationProvider>
<AuthProvider>
<CompanyProvider>
<UserProvider>
<EventProvider style={{flex: 1}}>
<GestureHandlerRootView style={{flex: 1}}>
<RootAppRouting />
</GestureHandlerRootView>
</EventProvider>
</UserProvider>
</CompanyProvider>
</AuthProvider>
</VibrationProvider>
</InternetConnectionProvider>
</NotificationProvider>
</DOXLEThemeProvider>
</OrientationProvider>
</SafeAreaProvider>
</QueryClientProvider>
);
}
export default App;