fix: enhance styling of LanguageSwitcher and ThemeSwitcher components

This commit is contained in:
hamster1963
2025-12-28 14:40:44 +08:00
parent 409ec0b62c
commit 4f9db466a3
2 changed files with 27 additions and 5 deletions
+12 -3
View File
@@ -35,15 +35,24 @@ export function ModeToggle() {
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className="flex flex-col gap-0.5" align="end">
<DropdownMenuItem className={cn({ "gap-3 bg-muted": theme === "light" })} onSelect={(e) => handleSelect(e, "light")}>
<DropdownMenuItem
className={cn("rounded-b-[5px]", { "gap-3 bg-muted font-semibold": theme === "light" })}
onSelect={(e) => handleSelect(e, "light")}
>
{t("theme.light")}
{theme === "light" && <CheckCircleIcon className="size-4" />}
</DropdownMenuItem>
<DropdownMenuItem className={cn({ "gap-3 bg-muted": theme === "dark" })} onSelect={(e) => handleSelect(e, "dark")}>
<DropdownMenuItem
className={cn("rounded-[5px]", { "gap-3 bg-muted font-semibold": theme === "dark" })}
onSelect={(e) => handleSelect(e, "dark")}
>
{t("theme.dark")}
{theme === "dark" && <CheckCircleIcon className="size-4" />}
</DropdownMenuItem>
<DropdownMenuItem className={cn({ "gap-3 bg-muted": theme === "system" })} onSelect={(e) => handleSelect(e, "system")}>
<DropdownMenuItem
className={cn("rounded-t-[5px]", { "gap-3 bg-muted font-semibold": theme === "system" })}
onSelect={(e) => handleSelect(e, "system")}
>
{t("theme.system")}
{theme === "system" && <CheckCircleIcon className="size-4" />}
</DropdownMenuItem>