-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
64 lines (54 loc) · 1.92 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
import * as Sentry from 'sentry-expo';
Sentry.init({
dsn: 'https://bd1e4216a645640180f9bc5169c65b74@o4505444279975936.ingest.sentry.io/4505713166909440',
enableInExpoDevelopment: false,
debug: false
});
import { NavigationContainer, Theme } from '@react-navigation/native';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import * as SplashScreen from 'expo-splash-screen';
import { StatusBar } from 'expo-status-bar';
import { useEffect, useState } from 'react';
import 'react-native-url-polyfill/auto';
import { HeaderButtonsProvider } from 'react-navigation-header-buttons';
import Routing from './src/Routing';
import { boot } from './src/lib/boot';
import { navigationRef } from './src/lib/navigation-ref';
import { color } from './src/lib/tailwind';
import { navigationLinking } from './src/lib/deep-linking';
const theme: Theme = {
dark: false,
colors: {
primary: color('accent'),
background: color('gray-100'),
card: color('white'),
text: color('black'),
border: 'rgba(0, 0, 0, 0.1)',
notification: color('red')
}
};
const queryClient = new QueryClient();
SplashScreen.preventAutoHideAsync();
export default Sentry.Native.wrap(() => {
const [isReady, setIsReady] = useState(false);
useEffect(() => {
(async () => {
await boot();
setIsReady(true);
setTimeout(SplashScreen.hideAsync);
})();
}, []);
if(!isReady) return;
return (
<>
<StatusBar animated style="auto"/>
<QueryClientProvider client={queryClient}>
<NavigationContainer linking={navigationLinking} ref={navigationRef} theme={theme}>
<HeaderButtonsProvider stackType="native">
<Routing/>
</HeaderButtonsProvider>
</NavigationContainer>
</QueryClientProvider>
</>
);
});