feat: optimize electron macos header style (#1774)

Co-authored-by: himself65 <himself65@outlook.com>
This commit is contained in:
Peng Xiao
2023-04-03 03:01:22 +08:00
committed by GitHub
parent fa150a93a0
commit e0eecffb2f
31 changed files with 635 additions and 169 deletions

View File

@@ -47,6 +47,7 @@ const ThemeProviderInner = memo<React.PropsWithChildren>(
// SSR will always render the light theme, so we need to defer the theme if user selected dark mode
const [deferTheme, setDeferTheme] = useState('light');
useEffect(() => {
window.apis?.onThemeChange(theme === 'dark' ? 'dark' : 'light');
setDeferTheme(theme === 'dark' ? 'dark' : 'light');
}, [theme]);
return (