Skip to content

Commit

Permalink
Enabled dropdown icons support in Breadcrumbs drop menu (#804)
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
  • Loading branch information
bexsoft authored May 22, 2024
1 parent b0b8cba commit 64329d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/components/Breadcrumbs/BreadcrumbButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,12 @@ const BreadcrumbButton: FC<
})}
compact
>
{subOptions.map((option) => (
{subOptions.map((option, index) => (
<ExpandMenuOption
key={`expand-opt-${option.label}-${index}`}
id={`expandOption-${option.label}`}
onClick={() => clickFunction(option)}
icon={option.icon}
>
{option.label}
</ExpandMenuOption>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Breadcrumbs/Breadcrumbs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ const subMenuOptions: BreadcrumbsOption[] = [
console.log("clicked", dt);
},
},
{ label: "SubLevel 2", to: "/lol" },
{ label: "SubLevel 2", to: "/lol", icon: <TestIcon /> },
{ label: "SubLevel 3", to: "/lol" },
{ label: "SubLevel 4", to: "/lol" },
{ label: "SubLevel 4", to: "/lol", icon: <TestIcon /> },
{ label: "SubLevel 5", to: "/lol" },
],
},
Expand Down
7 changes: 4 additions & 3 deletions src/components/Breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ const Breadcrumbs: FC<BreadcrumbsProps> = ({
dropArrow={false}
compact
>
{colOpts.map((option) => (
{colOpts.map((option, index) => (
<ExpandMenuOption
key={`expandOption-${option.label}-${index}`}
id={`expandOption-${option.label}`}
onClick={() => clickFunction(option)}
>
Expand Down Expand Up @@ -191,7 +192,7 @@ const Breadcrumbs: FC<BreadcrumbsProps> = ({
const lastItem = index === itSlide.length - 1;

return (
<Fragment>
<Fragment key={`expandOption-${itm.label}-${index}`}>
{index !== 0 && <Divider />}
<BreadcrumbButton
id={`breadcrumb-option-${itm.label}`}
Expand All @@ -211,7 +212,7 @@ const Breadcrumbs: FC<BreadcrumbsProps> = ({
const lastItem = index === options.length - 1;

return (
<Fragment>
<Fragment key={`expandOption-${itm.label}-${index}`}>
{index !== 0 && <Divider />}
<BreadcrumbButton
id={`breadcrumb-option-${itm.label}`}
Expand Down

0 comments on commit 64329d3

Please sign in to comment.