about summary refs log tree commit diff
path: root/src/App.web.tsx
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-02-06 11:43:51 -0800
committerGitHub <noreply@github.com>2024-02-06 11:43:51 -0800
commitec86282403ea34704d0faab7b04ca033bd3a0650 (patch)
treeca5881ada59d7ad634bd799efe3c751a4c5509d2 /src/App.web.tsx
parent856f80fc6df731b1dbe9efa289ad6a4f728d4e0d (diff)
downloadvoidsky-ec86282403ea34704d0faab7b04ca033bd3a0650.tar.zst
Options for selecting dark theme, fix some white flashes when in dark mode (#2722)
* add dark theme selection to settings/schema

* use `useThemePrefs` where needed

* adjust theme providers to support various themes

* update storybook

* handle web themes

* better themeing for web

* dont show dark theme prefs when color mode is light

* drop the inverted text change on oled theme

* get the color mode inside of `useColorModeTheme`

* use `ThemeName` type everywhere

* typo

* use dim/dark instead of dark/oled

* prevent any fickers on web

* fix styles

* use `dim` for dark default

* more cleanup

* 🤔

* set system background color

* ts
Diffstat (limited to 'src/App.web.tsx')
-rw-r--r--src/App.web.tsx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/App.web.tsx b/src/App.web.tsx
index 1efa0567c..9d1bd3506 100644
--- a/src/App.web.tsx
+++ b/src/App.web.tsx
@@ -10,7 +10,6 @@ import 'view/icons'
 import {ThemeProvider as Alf} from '#/alf'
 import {useColorModeTheme} from '#/alf/util/useColorModeTheme'
 import {init as initPersistedState} from '#/state/persisted'
-import {useColorMode} from 'state/shell'
 import {Shell} from 'view/shell/index'
 import {ToastContainer} from 'view/com/util/Toast.web'
 import {ThemeProvider} from 'lib/ThemeContext'
@@ -36,8 +35,7 @@ import {Provider as PortalProvider} from '#/components/Portal'
 function InnerApp() {
   const {isInitialLoad, currentAccount} = useSession()
   const {resumeSession} = useSessionApi()
-  const colorMode = useColorMode()
-  const theme = useColorModeTheme(colorMode)
+  const theme = useColorModeTheme()
 
   // init
   useEffect(() => {
@@ -55,7 +53,7 @@ function InnerApp() {
         key={currentAccount?.did}>
         <LoggedOutViewProvider>
           <UnreadNotifsProvider>
-            <ThemeProvider theme={colorMode}>
+            <ThemeProvider theme={theme}>
               {/* All components should be within this provider */}
               <RootSiblingParent>
                 <SafeAreaProvider>