diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-12-30 15:48:34 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-12-30 15:48:34 -0600 |
commit | a90fd5d26f1a8aa5149627a68a8dd6b13b26fec5 (patch) | |
tree | 63097a51789ae7c54cf8ec24273b2846e30152c5 /src/App.native.tsx | |
parent | 53267d755b583765d68062bd5879230d10a5dfa1 (diff) | |
download | voidsky-a90fd5d26f1a8aa5149627a68a8dd6b13b26fec5.tar.zst |
Add dark mode toggle
Diffstat (limited to 'src/App.native.tsx')
-rw-r--r-- | src/App.native.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/App.native.tsx b/src/App.native.tsx index fa523cd81..3cce25548 100644 --- a/src/App.native.tsx +++ b/src/App.native.tsx @@ -5,12 +5,13 @@ import {RootSiblingParent} from 'react-native-root-siblings' import {GestureHandlerRootView} from 'react-native-gesture-handler' import SplashScreen from 'react-native-splash-screen' import {SafeAreaProvider} from 'react-native-safe-area-context' +import {observer} from 'mobx-react-lite' import {ThemeProvider} from './view/lib/ThemeContext' import * as view from './view/index' import {RootStoreModel, setupState, RootStoreProvider} from './state' import {MobileShell} from './view/shell/mobile' -function App() { +const App = observer(() => { const [rootStore, setRootStore] = useState<RootStoreModel | undefined>( undefined, ) @@ -41,7 +42,7 @@ function App() { <GestureHandlerRootView style={{flex: 1}}> <RootSiblingParent> <RootStoreProvider value={rootStore}> - <ThemeProvider> + <ThemeProvider theme={rootStore.shell.darkMode ? 'dark' : 'light'}> <SafeAreaProvider> <MobileShell /> </SafeAreaProvider> @@ -50,6 +51,6 @@ function App() { </RootSiblingParent> </GestureHandlerRootView> ) -} +}) export default App |