fix(ui): unify layout wrappers and simplify player/shop detail pages

This commit is contained in:
zetaloop
2026-02-23 11:05:29 +08:00
parent c986539954
commit 4fce328ef1
11 changed files with 79 additions and 79 deletions
+28 -24
View File
@@ -93,44 +93,48 @@ export function Header() {
? `/player/${user.id}`
: "/settings"
: currentRole === "owner"
? `/shop/${ownerShop?.id ?? "shop1"}`
? ownerShop
? `/shop/${ownerShop.id}`
: "/dashboard/shop"
: user
? `/user/${user.id}`
: "/settings"
return (
<header className="sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
<div className="container mx-auto flex h-14 items-center gap-4 px-4">
<Link href="/" className="flex items-center gap-2 font-bold text-lg shrink-0">
<Gamepad2 className="h-5 w-5" />
</Link>
<div className="container mx-auto grid h-14 grid-cols-[1fr_auto_1fr] items-center gap-4 px-4">
<div className="flex items-center gap-4">
<Link href="/" className="flex items-center gap-2 font-bold text-lg shrink-0">
<Gamepad2 className="h-5 w-5" />
</Link>
<nav className="hidden md:flex items-center gap-1">
{navLinks.map((link) => (
<Link
key={link.href}
href={link.href}
className={cn(
"px-3 py-1.5 rounded-md text-sm font-medium transition-colors",
pathname === link.href || (link.href !== "/" && pathname.startsWith(link.href))
? "bg-accent text-accent-foreground"
: "text-muted-foreground hover:text-foreground hover:bg-accent/50",
)}
>
{link.label}
</Link>
))}
</nav>
<nav className="hidden md:flex items-center gap-1">
{navLinks.map((link) => (
<Link
key={link.href}
href={link.href}
className={cn(
"px-3 py-1.5 rounded-md text-sm font-medium transition-colors",
pathname === link.href || (link.href !== "/" && pathname.startsWith(link.href))
? "bg-accent text-accent-foreground"
: "text-muted-foreground hover:text-foreground hover:bg-accent/50",
)}
>
{link.label}
</Link>
))}
</nav>
</div>
<form onSubmit={handleSearch} className="hidden md:flex flex-1 max-w-sm">
<form onSubmit={handleSearch} className="hidden md:flex w-full md:w-64 lg:w-96">
<div className="relative w-full">
<Search className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" />
<Input name="q" placeholder="搜索打手、店铺..." className="pl-8 h-9" />
</div>
</form>
<div className="flex flex-1 md:flex-none items-center justify-end gap-1">
<div className="flex items-center justify-end gap-1">
{isAuthenticated ? (
<>
<DropdownMenu>