fix(ui): unify layout wrappers and simplify player/shop detail pages
This commit is contained in:
+28
-24
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user