about summary refs log tree commit diff
path: root/src/App.web.tsx
diff options
context:
space:
mode:
authorAnsh <anshnanda10@gmail.com>2023-09-15 22:02:44 +0530
committerGitHub <noreply@github.com>2023-09-15 09:32:44 -0700
commit188d4893f9f209aae10294bf72fe9f23ed399c28 (patch)
treeb87f291ff3f796d51578fd9f2e68e3311c8e74c2 /src/App.web.tsx
parent84b7edd9db4bb08f03b5c882da5542fc29a72232 (diff)
downloadvoidsky-188d4893f9f209aae10294bf72fe9f23ed399c28.tar.zst
add React Query and hook up to existing functionality (#1358)
* add React Query and hook up to existing functionality

* wire in remote data, add error message

* remove hard-coded feeds

* oops fix logic

* add loading state

* fix loading on mobile

---------

Co-authored-by: Eric Bailey <git@esb.lol>
Diffstat (limited to 'src/App.web.tsx')
-rw-r--r--src/App.web.tsx28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/App.web.tsx b/src/App.web.tsx
index 41a7189d3..a9123cc58 100644
--- a/src/App.web.tsx
+++ b/src/App.web.tsx
@@ -9,6 +9,8 @@ import {Shell} from './view/shell/index'
 import {ToastContainer} from './view/com/util/Toast.web'
 import {ThemeProvider} from 'lib/ThemeContext'
 import {observer} from 'mobx-react-lite'
+import {QueryClientProvider} from '@tanstack/react-query'
+import {queryClient} from 'lib/react-query'
 
 const App = observer(function AppImpl() {
   const [rootStore, setRootStore] = useState<RootStoreModel | undefined>(
@@ -30,18 +32,20 @@ const App = observer(function AppImpl() {
   }
 
   return (
-    <ThemeProvider theme={rootStore.shell.colorMode}>
-      <RootSiblingParent>
-        <analytics.Provider>
-          <RootStoreProvider value={rootStore}>
-            <SafeAreaProvider>
-              <Shell />
-            </SafeAreaProvider>
-            <ToastContainer />
-          </RootStoreProvider>
-        </analytics.Provider>
-      </RootSiblingParent>
-    </ThemeProvider>
+    <QueryClientProvider client={queryClient}>
+      <ThemeProvider theme={rootStore.shell.colorMode}>
+        <RootSiblingParent>
+          <analytics.Provider>
+            <RootStoreProvider value={rootStore}>
+              <SafeAreaProvider>
+                <Shell />
+              </SafeAreaProvider>
+              <ToastContainer />
+            </RootStoreProvider>
+          </analytics.Provider>
+        </RootSiblingParent>
+      </ThemeProvider>
+    </QueryClientProvider>
   )
 })