Skip to content

Commit

Permalink
Bjorwe/update profile menu (#229)
Browse files Browse the repository at this point in the history
* feat(topbar): add property to hide top divider when adding custom content to profile menu

* feat(topbar): add activation ring on profile menu trigger button
  • Loading branch information
bjornwedell authored Mar 18, 2024
1 parent 97f8a71 commit f7af0a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/topbar/src/profile-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const NotificationIcon = bundleIcon(CircleRegular, CircleFilled);

export const ProfileMenu = ({
customContent,
showCustomContentTopDivider = true,
language,
name,
email,
Expand All @@ -49,6 +50,7 @@ export const ProfileMenu = ({
<Avatar
name={name}
size={24}
active={hasNotification ? "active" : "unset"}
badge={hasNotification
? {
icon: notificationIcon !== undefined
Expand All @@ -72,7 +74,9 @@ export const ProfileMenu = ({
<MenuPopover>
<MenuList>
<UserInformation name={name} email={email} tag={tag} />
<MenuDivider />
{(customContent === undefined || showCustomContentTopDivider) && (
<MenuDivider />
)}
{customContent !== undefined && (
<>
{customContent}
Expand Down
1 change: 1 addition & 0 deletions components/topbar/src/profile-menu.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export type UserInformationProps = {

export type ProfileMenuProps = UserInformationProps & {
readonly customContent?: JSX.Element;
readonly showCustomContentTopDivider?: boolean;
readonly hasNotification?: boolean;
readonly notificationIcon?: ReactElement;
readonly language: LanguageSubmenuProps;
Expand Down
1 change: 1 addition & 0 deletions examples/src/components/top-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export const Navbar = () => {
value: currentOrganizationId,
}}
profileMenu={{
// showCustomContentTopDivider: false,
customContent: (
<MenuItem
icon={<OpenRegular />}
Expand Down

0 comments on commit f7af0a9

Please sign in to comment.