-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
41 lines (33 loc) · 1.26 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
import React, {useEffect} from 'react';
import {settingsService} from '@services';
import {ThemeProvider} from '@shopify/restyle';
import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import {Toast} from '@components';
import {useAppColorScheme} from '@hooks';
import {Routes} from '@routes';
import {AuthCredentialsProvider} from './src/services/authCredentials/providers/AuthCredentialsProvider';
import {initializeStorage} from './src/services/storage';
import {MMKVStorage} from './src/services/storage/implementation/MMKVStorage';
import {darkTheme, theme} from './src/theme/theme';
initializeStorage(MMKVStorage);
const queryClient = new QueryClient();
export function App(): JSX.Element {
const {appColor} = useAppColorScheme();
useEffect(() => {
settingsService.handleStatusBar(appColor);
}, [appColor]);
return (
<AuthCredentialsProvider>
<QueryClientProvider client={queryClient}>
<SafeAreaProvider>
<ThemeProvider theme={appColor === 'dark' ? darkTheme : theme}>
<Routes />
<Toast />
</ThemeProvider>
</SafeAreaProvider>
</QueryClientProvider>
</AuthCredentialsProvider>
);
}
export default App;