Skip to content

Commit

Permalink
FIxed overflow issues on sidebar's menu
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalabbad committed Feb 3, 2025
1 parent 8fe600b commit ea75834
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 2 additions & 0 deletions changelog/+menu.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fixed issue causing a gap in menu sidebar when text is too long.
- Prevent avatar from being cut off in menu sidebar.
2 changes: 1 addition & 1 deletion frontend/app/src/shared/components/account-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const AuthenticatedAccountMenu = ({
<DropdownMenuTrigger asChild>
<Button
variant="ghost"
className="h-auto w-full justify-start gap-2 hover:bg-indigo-50 rounded-lg p-2 overflow-hidden text-left"
className="h-auto w-full justify-start gap-2 hover:bg-indigo-50 rounded-lg p-2 overflow-hidden text-left shrink-0"
data-testid="authenticated-menu-trigger"
>
<Avatar name={profile?.name?.value} className="h-10 w-10 shrink-0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ const TopLevelMenuItem: React.FC<{
}> = ({ item, isCollapsed }) => {
if (!item.children?.length) {
return (
<Link to={constructPath(item.path)} className={menuNavigationItemStyle}>
<Link
to={constructPath(item.path)}
className={classNames(menuNavigationItemStyle, "w-[224px]")}
>
<MenuItemIcon item={item} />
<span className={classNames("text-sm", isCollapsed && "hidden")}>{item.label}</span>
</Link>
Expand All @@ -96,7 +99,9 @@ const TopLevelMenuItem: React.FC<{

return (
<DropdownMenu>
<DropdownMenuTrigger className={classNames(menuNavigationItemStyle, isCollapsed && "p-2")}>
<DropdownMenuTrigger
className={classNames(menuNavigationItemStyle, isCollapsed ? "p-2" : "w-[224px]")}
>
<Tooltip enabled={isCollapsed} content={item.label} side="right">
<span className="flex">
<MenuItemIcon item={item} />
Expand All @@ -123,10 +128,8 @@ const TopLevelMenuItem: React.FC<{
);
};

export const MenuSectionObject: React.FC<MenuSectionObjectsProps> = ({ isCollapsed, items }) => (
<div className="flex flex-col w-full overflow-auto">
{items.map((item) => (
<TopLevelMenuItem key={item.identifier} item={item} isCollapsed={isCollapsed} />
))}
</div>
);
export const MenuSectionObject: React.FC<MenuSectionObjectsProps> = ({ isCollapsed, items }) => {
return items.map((item) => (
<TopLevelMenuItem key={item.identifier} item={item} isCollapsed={isCollapsed} />
));
};

0 comments on commit ea75834

Please sign in to comment.