代码修改

This commit is contained in:
董宏凯 committed 2026-07-24 14:12:42 +08:00
1 parent 91ba47bf47
commit 25153dbd84
31 files changed
+536 -62

No files matched your search

@@ -214,7 +214,7 @@ export function AppearanceSettingsPage({ onClose }: { onClose?: () => void }) {
};
const handleSetGlobalDefault = async (
value: "light" | "dark" | "lightblue" | "lightgreen" | "iceblue",
value: "light" | "dark" | "lightblue" | "lightgreen" | "iceblue" | "lightyellow",
) => {
if (value === globalDefault) return;
try {
@@ -228,7 +228,9 @@ export function AppearanceSettingsPage({ onClose }: { onClose?: () => void }) {
? "绿色"
: value === "iceblue"
? "冰川蓝"
: "浅蓝";
: value === "lightyellow"
? "浅黄色"
: "浅蓝";
toast.success(`已将系统默认主题设置为${label}`);
} catch (e) {
toast.error(e instanceof Error ? e.message : "保存失败");
@@ -396,6 +398,12 @@ export function AppearanceSettingsPage({ onClose }: { onClose?: () => void }) {
description: t.settings.appearance.iceblueDescription,
icon: SnowflakeIcon,
},
{
id: "lightyellow",
label: t.settings.appearance.lightyellow,
description: t.settings.appearance.lightyellowDescription,
icon: SunIcon,
},
],
[
t.settings.appearance.dark,
@@ -408,6 +416,8 @@ export function AppearanceSettingsPage({ onClose }: { onClose?: () => void }) {
t.settings.appearance.lightgreenDescription,
t.settings.appearance.iceblue,
t.settings.appearance.iceblueDescription,
t.settings.appearance.lightyellow,
t.settings.appearance.lightyellowDescription,
],
);
@@ -425,7 +435,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" | "iceblue"}
mode={option.id as "light" | "dark" | "lightblue" | "lightgreen" | "iceblue" | "lightyellow"}
onSelect={(value) => setTheme(value)}
/>
))}
@@ -597,6 +607,16 @@ export function AppearanceSettingsPage({ onClose }: { onClose?: () => void }) {
<SnowflakeIcon className="mr-1.5 size-4" />
冰川蓝
</Button>
<Button
type="button"
variant={globalDefault === "lightyellow" ? "default" : "outline"}
size="sm"
onClick={() => void handleSetGlobalDefault("lightyellow")}
disabled={updateAppearance.isPending}
>
<SunIcon className="mr-1.5 size-4" />
浅黄色
</Button>
<p className="text-muted-foreground ml-2 text-xs">
当前系统默认:
{globalDefault === "light"
@@ -607,7 +627,9 @@ export function AppearanceSettingsPage({ onClose }: { onClose?: () => void }) {
? "绿色"
: globalDefault === "iceblue"
? "冰川蓝"
: "浅蓝"}
: globalDefault === "lightyellow"
? "浅黄色"
: "浅蓝"}
</p>
</div>
</SettingsSection>
@@ -1124,8 +1146,8 @@ function ThemePreviewCard({
label: string;
description: string;
active: boolean;
mode: "light" | "dark" | "lightblue" | "lightgreen" | "iceblue";
onSelect: (mode: "light" | "dark" | "lightblue" | "lightgreen" | "iceblue") => void;
mode: "light" | "dark" | "lightblue" | "lightgreen" | "iceblue" | "lightyellow";
onSelect: (mode: "light" | "dark" | "lightblue" | "lightgreen" | "iceblue" | "lightyellow") => void;
}) {
const previewMode = mode;
return (
@@ -1161,7 +1183,9 @@ function ThemePreviewCard({
? "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",
: previewMode === "lightyellow"
? "border-lime-200 bg-[#FCFDF5] text-[#303D23]"
: "border-slate-200 bg-white text-slate-900",
)}
>
<div className="border-border/50 flex items-center gap-2 border-b px-3 py-2">
@@ -1176,7 +1200,9 @@ function ThemePreviewCard({
? "bg-[#07c05f]"
: previewMode === "iceblue"
? "bg-[#9BCEF1]"
: "bg-[#cf1322]",
: previewMode === "lightyellow"
? "bg-[#F3FBD9]"
: "bg-[#cf1322]",
)}
/>
<div className="h-2 w-10 rounded-full bg-current/20" />