Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions packages/ui-components/Common/Breadcrumbs/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@ export const Default: Story = {
},
};

export const Linkless: Story = {
args: {
links: [
{
label: 'Learn',
href: '',
},
{
label: 'Getting Started',
href: '',
},
{
label: 'Introduction to Node.js',
href: '',
},
],
},
};

export const Truncate: Story = {
args: {
links: [
Expand Down
14 changes: 11 additions & 3 deletions packages/ui-components/Common/Breadcrumbs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,17 @@ const Breadcrumbs: FC<BreadcrumbsProps> = ({
hideSeparator={isLastItem}
position={position + +!hideHome}
>
<BreadcrumbLink as={as} href={link.href} active={isLastItem}>
{link.label}
</BreadcrumbLink>
{link.href || isLastItem ? (
<BreadcrumbLink
as={as}
href={link.href || undefined}
active={isLastItem}
>
{link.label}
</BreadcrumbLink>
) : (
<span className="opacity-70">{link.label}</span>
)}
</BreadcrumbItem>
);
}),
Expand Down
Loading