From 78760ceebb80065955615026fd84b202dbef9904 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Fri, 7 Aug 2026 20:26:47 -0400 Subject: [PATCH] Refactor status bar theme handling, attempt to remove the black spaces --- src/hooks/useStatusBar.js | 6 ++---- src/utils/StatusBarManager.js | 8 +++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/hooks/useStatusBar.js b/src/hooks/useStatusBar.js index 9075adc..e6ac4e9 100644 --- a/src/hooks/useStatusBar.js +++ b/src/hooks/useStatusBar.js @@ -1,5 +1,6 @@ import { useColorScheme } from '@mui/joy' import { useEffect } from 'react' + import statusBarManager from '../utils/StatusBarManager' /** @@ -35,10 +36,7 @@ export const useStatusBar = () => { // Update the status bar with the resolved theme await statusBarManager.updateResolvedTheme(resolvedTheme) - - // Also update the base theme for future reference - await statusBarManager.setTheme(mode) - + // Notify any custom listeners statusBarManager.notifyThemeChange(resolvedTheme) } diff --git a/src/utils/StatusBarManager.js b/src/utils/StatusBarManager.js index ce8fc62..1115332 100644 --- a/src/utils/StatusBarManager.js +++ b/src/utils/StatusBarManager.js @@ -52,14 +52,12 @@ class StatusBarManager { this.currentTheme = theme try { - let style = Style.Light // Default to light content (dark status bar) + let style = Style.Light // Dark content for a light background if (theme === 'dark') { - style = Style.Dark // Dark content (light status bar) + style = Style.Dark // Light content for a dark background } else if (theme === 'system') { - // For system theme, we need to detect the actual system preference - // Joy UI's useColorScheme will handle this, but we default to light - style = Style.Light + style = Style.Default } await StatusBar.setStyle({ style })