fix(ui): sync toast theme with app setting

This commit is contained in:
YoVinchen
2026-01-16 15:56:43 +08:00
committed by Jason
parent 4edb08cd53
commit ae5d05b08c
2 changed files with 10 additions and 3 deletions
+2 -2
View File
@@ -635,7 +635,7 @@ function App() {
}
>
<div
className="flex h-full items-center justify-between gap-2 px-6"
className="mx-auto flex h-full max-w-[56rem] items-center justify-between gap-2 px-4"
data-tauri-drag-region
style={{ WebkitAppRegion: "drag" } as any}
>
@@ -730,7 +730,7 @@ function App() {
</div>
<div
className="flex items-center gap-2 h-[32px]"
className="flex items-center gap-1.5 h-[32px]"
style={{ WebkitAppRegion: "no-drag" } as any}
>
{currentView === "prompts" && (
+8 -1
View File
@@ -1,11 +1,18 @@
import { Toaster as SonnerToaster } from "sonner";
import { useTheme } from "@/components/theme-provider";
export function Toaster() {
const { theme } = useTheme();
// 将应用主题映射到 Sonner 的主题
// 如果是 "system"Sonner 会自己处理
const sonnerTheme = theme === "system" ? "system" : theme;
return (
<SonnerToaster
position="top-center"
richColors
theme="system"
theme={sonnerTheme}
toastOptions={{
duration: 2000,
classNames: {