Wrap user menu email label in a dropdown group
DropdownGroupLabel renders Base UI's Menu.GroupLabel, which requires a Menu.Group ancestor. The user menu rendered the label directly in the popup, so opening it threw a missing MenuGroupContext error. Wrap the email label in a DropdownGroup. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
import { CaretDownIcon, SignOutIcon, UserIcon } from "@phosphor-icons/react";
|
import { CaretDownIcon, SignOutIcon, UserIcon } from "@phosphor-icons/react";
|
||||||
import { Avatar } from "@probo/ui/src/v2/Avatar/Avatar";
|
import { Avatar } from "@probo/ui/src/v2/Avatar/Avatar";
|
||||||
import { Dropdown } from "@probo/ui/src/v2/Dropdown/Dropdown";
|
import { Dropdown } from "@probo/ui/src/v2/Dropdown/Dropdown";
|
||||||
|
import { DropdownGroup } from "@probo/ui/src/v2/Dropdown/DropdownGroup";
|
||||||
import { DropdownGroupLabel } from "@probo/ui/src/v2/Dropdown/DropdownGroupLabel";
|
import { DropdownGroupLabel } from "@probo/ui/src/v2/Dropdown/DropdownGroupLabel";
|
||||||
import { DropdownItem } from "@probo/ui/src/v2/Dropdown/DropdownItem";
|
import { DropdownItem } from "@probo/ui/src/v2/Dropdown/DropdownItem";
|
||||||
import { DropdownPopup } from "@probo/ui/src/v2/Dropdown/DropdownPopup";
|
import { DropdownPopup } from "@probo/ui/src/v2/Dropdown/DropdownPopup";
|
||||||
@@ -62,7 +63,9 @@ export function TopBarUserMenu({ identityKey }: TopBarUserMenuProps) {
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<DropdownPopup align="end">
|
<DropdownPopup align="end">
|
||||||
<DropdownGroupLabel>{identity.email}</DropdownGroupLabel>
|
<DropdownGroup>
|
||||||
|
<DropdownGroupLabel>{identity.email}</DropdownGroupLabel>
|
||||||
|
</DropdownGroup>
|
||||||
<DropdownSeparator />
|
<DropdownSeparator />
|
||||||
<DropdownItem color="error" iconStart={<SignOutIcon />}>
|
<DropdownItem color="error" iconStart={<SignOutIcon />}>
|
||||||
{t("userMenu.signOut")}
|
{t("userMenu.signOut")}
|
||||||
|
|||||||
Reference in New Issue
Block a user