Fix profile dropdown crash by wrapping GroupLabel in Group

Menu.GroupLabel requires a parent Menu.Group for context. Without it,
clicking the profile avatar crashed the client.

Made-with: Cursor
This commit is contained in:
Randall Stillwell 2026-04-07 12:13:16 -05:00
parent 41000337e3
commit 6fdf68bc89

View file

@ -21,6 +21,7 @@ import {
DropdownMenu,
DropdownMenuTrigger,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuLabel,
@ -122,26 +123,28 @@ export function TopBar() {
</Avatar>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" sideOffset={8} className="w-56">
<DropdownMenuLabel className="font-normal">
<div className="flex items-center gap-3 px-0.5 py-1">
<Avatar>
{profile.avatarUrl && <AvatarImage src={profile.avatarUrl} alt={profile.displayName} />}
<AvatarFallback className="text-xs">
{initials || <User className="size-4" />}
</AvatarFallback>
</Avatar>
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-foreground">
{profile.displayName || "Set up profile"}
</p>
{profile.email && (
<p className="truncate text-xs text-muted-foreground">
{profile.email}
<DropdownMenuGroup>
<DropdownMenuLabel className="font-normal">
<div className="flex items-center gap-3 px-0.5 py-1">
<Avatar>
{profile.avatarUrl && <AvatarImage src={profile.avatarUrl} alt={profile.displayName} />}
<AvatarFallback className="text-xs">
{initials || <User className="size-4" />}
</AvatarFallback>
</Avatar>
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-foreground">
{profile.displayName || "Set up profile"}
</p>
)}
{profile.email && (
<p className="truncate text-xs text-muted-foreground">
{profile.email}
</p>
)}
</div>
</div>
</div>
</DropdownMenuLabel>
</DropdownMenuLabel>
</DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuItem render={<Link href="/profile" />}>
<UserCircle className="size-4" />