fix(ui): gate app sidebar to md+ and use onSelect for logout (keyboard path)

This commit is contained in:
2026-09-08 17:41:29 +08:00
parent 7957e5cee5
commit 52e95a48d8
2 changed files with 4 additions and 6 deletions
+3 -5
View File
@@ -57,10 +57,8 @@ export function AppShell() {
<DropdownMenuContent align="end">
<DropdownMenuLabel>{user?.username}{isAdmin ? " · admin" : ""}</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<span className="cursor-pointer" onClick={logout}>
<LogOut /> 退出登录
</span>
<DropdownMenuItem onSelect={logout}>
<LogOut /> 退出登录
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
@@ -69,7 +67,7 @@ export function AppShell() {
return (
<div className="flex h-full">
{/* 桌面/平板侧栏;lg 全文标签,md 图标栏 */}
<aside className="flex w-14 shrink-0 flex-col gap-1 border-r bg-card/60 p-2 lg:w-60">
<aside className="hidden w-14 shrink-0 flex-col gap-1 border-r bg-card/60 p-2 md:flex lg:w-60">
<Brand compact />
<nav aria-label="主导航" className="flex flex-col gap-1">
<NavItem to="/" icon={<BookOpen className="size-4 shrink-0" />} label="书架" />
+1 -1
View File
@@ -14,7 +14,7 @@ export function ThemeToggle() {
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon" aria-label="切换主题" aria-pressed="false">
<Button variant="ghost" size="icon" aria-label="切换主题">
{theme === "dark" ? <Moon className="size-4" /> : theme === "light" ? <Sun className="size-4" /> : <Monitor className="size-4" />}
</Button>
</DropdownMenuTrigger>