代码提交

This commit is contained in:
董宏凯 committed 2026-07-24 10:33:28 +08:00
1 parent f49def09ea
commit 45df500a9c
55 files changed
+3390 -461

No files matched your search

@@ -12,6 +12,7 @@ import {
MoonIcon,
PanelLeftIcon,
Plus,
SnowflakeIcon,
SunIcon,
Trash2,
} from "lucide-react";
@@ -213,7 +214,7 @@ export function AppearanceSettingsPage({ onClose }: { onClose?: () => void }) {
};
const handleSetGlobalDefault = async (
value: "light" | "dark" | "lightblue" | "lightgreen",
value: "light" | "dark" | "lightblue" | "lightgreen" | "iceblue",
) => {
if (value === globalDefault) return;
try {
@@ -225,7 +226,9 @@ export function AppearanceSettingsPage({ onClose }: { onClose?: () => void }) {
? "深色"
: value === "lightgreen"
? "绿色"
: "浅蓝";
: value === "iceblue"
? "冰川蓝"
: "浅蓝";
toast.success(`已将系统默认主题设置为${label}`);
} catch (e) {
toast.error(e instanceof Error ? e.message : "保存失败");
@@ -387,6 +390,12 @@ export function AppearanceSettingsPage({ onClose }: { onClose?: () => void }) {
description: t.settings.appearance.lightgreenDescription,
icon: LeafIcon,
},
{
id: "iceblue",
label: t.settings.appearance.iceblue,
description: t.settings.appearance.iceblueDescription,
icon: SnowflakeIcon,
},
],
[
t.settings.appearance.dark,
@@ -397,6 +406,8 @@ export function AppearanceSettingsPage({ onClose }: { onClose?: () => void }) {
t.settings.appearance.lightblueDescription,
t.settings.appearance.lightgreen,
t.settings.appearance.lightgreenDescription,
t.settings.appearance.iceblue,
t.settings.appearance.iceblueDescription,
],
);
@@ -414,7 +425,7 @@ export function AppearanceSettingsPage({ onClose }: { onClose?: () => void }) {
label={option.label}
description={option.description}
active={currentTheme === option.id}
mode={option.id as "light" | "dark" | "lightblue" | "lightgreen"}
mode={option.id as "light" | "dark" | "lightblue" | "lightgreen" | "iceblue"}
onSelect={(value) => setTheme(value)}
/>
))}
@@ -576,6 +587,16 @@ export function AppearanceSettingsPage({ onClose }: { onClose?: () => void }) {
<LeafIcon className="mr-1.5 size-4" />
绿色
</Button>
<Button
type="button"
variant={globalDefault === "iceblue" ? "default" : "outline"}
size="sm"
onClick={() => void handleSetGlobalDefault("iceblue")}
disabled={updateAppearance.isPending}
>
<SnowflakeIcon className="mr-1.5 size-4" />
冰川蓝
</Button>
<p className="text-muted-foreground ml-2 text-xs">
当前系统默认:
{globalDefault === "light"
@@ -584,7 +605,9 @@ export function AppearanceSettingsPage({ onClose }: { onClose?: () => void }) {
? "深色"
: globalDefault === "lightgreen"
? "绿色"
: "浅蓝"}
: globalDefault === "iceblue"
? "冰川蓝"
: "浅蓝"}
</p>
</div>
</SettingsSection>
@@ -1101,8 +1124,8 @@ function ThemePreviewCard({
label: string;
description: string;
active: boolean;
mode: "light" | "dark" | "lightblue" | "lightgreen";
onSelect: (mode: "light" | "dark" | "lightblue" | "lightgreen") => void;
mode: "light" | "dark" | "lightblue" | "lightgreen" | "iceblue";
onSelect: (mode: "light" | "dark" | "lightblue" | "lightgreen" | "iceblue") => void;
}) {
const previewMode = mode;
return (
@@ -1134,8 +1157,10 @@ function ThemePreviewCard({
? "border-neutral-800 bg-neutral-900 text-neutral-200"
: previewMode === "lightblue"
? "border-blue-200 bg-white text-slate-900"
: previewMode === "lightgreen"
? "border-emerald-200 bg-white text-emerald-950"
: previewMode === "lightgreen"
? "border-emerald-200 bg-white text-emerald-950"
: previewMode === "iceblue"
? "border-sky-200 bg-[#F7FBFE] text-[#18324A]"
: "border-slate-200 bg-white text-slate-900",
)}
>
@@ -1147,8 +1172,10 @@ function ThemePreviewCard({
? "bg-emerald-400"
: previewMode === "lightblue"
? "bg-blue-500"
: previewMode === "lightgreen"
? "bg-[#07c05f]"
: previewMode === "lightgreen"
? "bg-[#07c05f]"
: previewMode === "iceblue"
? "bg-[#9BCEF1]"
: "bg-[#cf1322]",
)}
/>