File tree 2 files changed +30
-3
lines changed
packages/ui-components/Common/Breadcrumbs
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 = {
24
24
} ,
25
25
} ;
26
26
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
+
27
46
export const Truncate : Story = {
28
47
args : {
29
48
links : [
Original file line number Diff line number Diff line change @@ -51,9 +51,17 @@ const Breadcrumbs: FC<BreadcrumbsProps> = ({
51
51
hideSeparator = { isLastItem }
52
52
position = { position + + ! hideHome }
53
53
>
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
+ ) }
57
65
</ BreadcrumbItem >
58
66
) ;
59
67
} ) ,
You can’t perform that action at this time.
0 commit comments