From 323472ab2ba981711f7731a313cc2b81a9dd037a Mon Sep 17 00:00:00 2001 From: wonder Date: Sun, 24 May 2026 21:09:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(theme):=20App=20=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E6=97=B6=E8=AE=BE=E7=BD=AE=20data-theme=20=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=EF=BC=8C=E9=A6=96=E6=AC=A1=E6=B8=B2=E6=9F=93=E5=8D=B3?= =?UTF-8?q?=E4=B8=BA=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index c3ffe69..1672697 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -2,14 +2,20 @@ import { useEffect } from 'react' import { RouterProvider } from 'react-router-dom' import { router } from './router' import { useAuthStore } from './stores/auth' +import { useThemeStore } from './stores/theme' import './styles/global.css' export default function App() { const loadFromStorage = useAuthStore(s => s.loadFromStorage) + const theme = useThemeStore(s => s.theme) useEffect(() => { loadFromStorage() }, [loadFromStorage]) + useEffect(() => { + document.documentElement.setAttribute('data-theme', theme) + }, [theme]) + return }