File tree Expand file tree Collapse file tree 2 files changed +30
-3
lines changed
packages/ui-components/Common/Breadcrumbs Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,25 @@ export const Default: Story = {
2424 } ,
2525} ;
2626
27+ export const Linkless : Story = {
28+ args : {
29+ links : [
30+ {
31+ label : 'Learn' ,
32+ href : '' ,
33+ } ,
34+ {
35+ label : 'Getting Started' ,
36+ href : '' ,
37+ } ,
38+ {
39+ label : 'Introduction to Node.js' ,
40+ href : '' ,
41+ } ,
42+ ] ,
43+ } ,
44+ } ;
45+
2746export const Truncate : Story = {
2847 args : {
2948 links : [
Original file line number Diff line number Diff line change @@ -51,9 +51,17 @@ const Breadcrumbs: FC<BreadcrumbsProps> = ({
5151 hideSeparator = { isLastItem }
5252 position = { position + + ! hideHome }
5353 >
54- < BreadcrumbLink as = { as } href = { link . href } active = { isLastItem } >
55- { link . label }
56- </ BreadcrumbLink >
54+ { link . href || isLastItem ? (
55+ < BreadcrumbLink
56+ as = { as }
57+ href = { link . href || undefined }
58+ active = { isLastItem }
59+ >
60+ { link . label }
61+ </ BreadcrumbLink >
62+ ) : (
63+ < span className = "opacity-70" > { link . label } </ span >
64+ ) }
5765 </ BreadcrumbItem >
5866 ) ;
5967 } ) ,
You can’t perform that action at this time.
0 commit comments