mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-27 16:26:16 +08:00
fix(ui): sync toast theme with app setting
This commit is contained in:
+2
-2
@@ -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" && (
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user