about summary refs log tree commit diff
path: root/src/App.native.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-11-07 13:37:47 -0600
committerGitHub <noreply@github.com>2023-11-07 11:37:47 -0800
commitbfe196bac5e618bfbeab4f6fabef3e5a18194868 (patch)
treef3fd74b8472f5bcd3bbcf3b111a0f19b059de404 /src/App.native.tsx
parent7158157f5fe07b8f97842736ea87b598baabb7da (diff)
downloadvoidsky-bfe196bac5e618bfbeab4f6fabef3e5a18194868.tar.zst
Extract shell state into separate context (#1824)
* WIP

* Add shell state

* Integrate new shell state for drawer and minimal shell mode

* Replace isDrawerSwipeDisabled

* Split shell state into separate contexts to avoid needless re-renders

* Fix typo

---------

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
Diffstat (limited to 'src/App.native.tsx')
-rw-r--r--src/App.native.tsx31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/App.native.tsx b/src/App.native.tsx
index 3250ea563..a99dbc951 100644
--- a/src/App.native.tsx
+++ b/src/App.native.tsx
@@ -19,6 +19,7 @@ import * as analytics from 'lib/analytics/analytics'
 import * as Toast from 'view/com/util/Toast'
 import {queryClient} from 'lib/react-query'
 import {TestCtrls} from 'view/com/testing/TestCtrls'
+import {Provider as ShellStateProvider} from 'state/shell'
 
 SplashScreen.preventAutoHideAsync()
 
@@ -44,20 +45,22 @@ const App = observer(function AppImpl() {
     return null
   }
   return (
-    <QueryClientProvider client={queryClient}>
-      <ThemeProvider theme={rootStore.shell.colorMode}>
-        <RootSiblingParent>
-          <analytics.Provider>
-            <RootStoreProvider value={rootStore}>
-              <GestureHandlerRootView style={s.h100pct}>
-                <TestCtrls />
-                <Shell />
-              </GestureHandlerRootView>
-            </RootStoreProvider>
-          </analytics.Provider>
-        </RootSiblingParent>
-      </ThemeProvider>
-    </QueryClientProvider>
+    <ShellStateProvider>
+      <QueryClientProvider client={queryClient}>
+        <ThemeProvider theme={rootStore.shell.colorMode}>
+          <RootSiblingParent>
+            <analytics.Provider>
+              <RootStoreProvider value={rootStore}>
+                <GestureHandlerRootView style={s.h100pct}>
+                  <TestCtrls />
+                  <Shell />
+                </GestureHandlerRootView>
+              </RootStoreProvider>
+            </analytics.Provider>
+          </RootSiblingParent>
+        </ThemeProvider>
+      </QueryClientProvider>
+    </ShellStateProvider>
   )
 })