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:
parent
41000337e3
commit
6fdf68bc89
1 changed files with 21 additions and 18 deletions
|
|
@ -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" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue