User feedback: still ugly, the 1xbet navigation was never actually reproduced. Now follows its structure: - thin utility bar on top (country picker, Connexion + Inscription) above the main bar (logo, nav) - horizontal icon strip of the country's lotteries under the header, with the active one underlined in gold - compact promo banner instead of a full-height hero, so results stay above the fold - right rail in the bet-slip position: top-5 leaderboard and army stats Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
62 lines
2.1 KiB
TypeScript
62 lines
2.1 KiB
TypeScript
import Link from "next/link"
|
|
import { getCurrentMember } from "@/lib/member-auth"
|
|
import { Button } from "@/components/ui/button"
|
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
|
|
import {
|
|
DropdownMenu,
|
|
DropdownMenuContent,
|
|
DropdownMenuItem,
|
|
DropdownMenuSeparator,
|
|
DropdownMenuTrigger,
|
|
} from "@/components/ui/dropdown-menu"
|
|
|
|
export async function UserMenu() {
|
|
const member = await getCurrentMember()
|
|
|
|
if (!member) {
|
|
return (
|
|
<div className="flex items-center gap-1.5">
|
|
<Button asChild size="sm" variant="ghost" className="h-7 px-3 text-xs">
|
|
<Link href="/connexion">Connexion</Link>
|
|
</Button>
|
|
<Button asChild size="sm" className="h-7 px-3 text-xs font-semibold">
|
|
<Link href="/connexion?mode=inscription">Inscription</Link>
|
|
</Button>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
const displayName = member.publicNickname || member.name
|
|
const initial = displayName.charAt(0).toUpperCase()
|
|
|
|
return (
|
|
<DropdownMenu>
|
|
<DropdownMenuTrigger className="flex items-center gap-2 rounded-full text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring">
|
|
<span className="hidden text-muted-foreground sm:inline">{displayName}</span>
|
|
<Avatar className="h-6 w-6">
|
|
<AvatarImage src={member.avatarUrl ?? undefined} alt="" />
|
|
<AvatarFallback>{initial}</AvatarFallback>
|
|
</Avatar>
|
|
</DropdownMenuTrigger>
|
|
<DropdownMenuContent align="end" className="w-52">
|
|
<div className="px-2 py-1.5 text-sm font-medium">{displayName}</div>
|
|
<DropdownMenuSeparator />
|
|
<DropdownMenuItem asChild>
|
|
<Link href="/profil">Mon profil</Link>
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem asChild>
|
|
<Link href="/classement">Classement</Link>
|
|
</DropdownMenuItem>
|
|
<DropdownMenuSeparator />
|
|
<DropdownMenuItem asChild>
|
|
<form action="/api/auth/logout" method="post" className="w-full">
|
|
<button type="submit" className="w-full text-left">
|
|
Déconnexion
|
|
</button>
|
|
</form>
|
|
</DropdownMenuItem>
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
)
|
|
}
|