-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
40 lines (36 loc) · 1.22 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
import { StatusBar } from 'expo-status-bar';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import useCachedResources from './hooks/useCachedResources';
import useColorScheme from './hooks/useColorScheme';
import Navigation from './navigation';
import { I18nextProvider, useTranslation } from 'react-i18next';
import i18n from './i18n';
import {
MD3LightTheme as DefaultTheme,
Provider as PaperProvider,
} from 'react-native-paper';
import { colors } from './colors';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
const theme = {
...DefaultTheme,
colors: colors, // Copy it from the color codes scheme and then use it here
};
const queryClient = new QueryClient();
export default function App() {
const isLoadingComplete = useCachedResources();
const colorScheme = useColorScheme();
if (!isLoadingComplete) {
return null;
} else {
return (
<QueryClientProvider client={queryClient}>
<PaperProvider theme={theme}>
<SafeAreaProvider>
<Navigation colorScheme={colorScheme} />
<StatusBar />
</SafeAreaProvider>
</PaperProvider>
</QueryClientProvider>
);
}
}