-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
41 lines (34 loc) · 1.1 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 "text-encoding";
import React from "react";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { polyfillWebCrypto } from "expo-standard-web-crypto";
import { StatusBar } from "expo-status-bar";
import { NostrProvider } from "nostr-react";
import { DEFAULT_RELAYS } from "./constants/relay";
import useColorScheme from "./hooks/useColorScheme";
import useInitApp from "./hooks/useInitApp";
import Navigation from "./navigation";
polyfillWebCrypto();
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: Infinity,
},
},
});
export default function App() {
const isAppInitialized = useInitApp();
const colorScheme = useColorScheme();
if (!isAppInitialized) return null;
return (
<QueryClientProvider client={queryClient}>
<NostrProvider relayUrls={DEFAULT_RELAYS}>
<SafeAreaProvider>
<StatusBar />
<Navigation colorScheme={colorScheme} />
</SafeAreaProvider>
</NostrProvider>
</QueryClientProvider>
);
}