Skip to content

Commit 9d5da4a

Browse files
authored
Improve breadcrumb component (#667)
1 parent b5da7e7 commit 9d5da4a

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@nordcloud/gnui",
33
"description": "Nordcloud Design System - a collection of reusable React components used in Nordcloud's SaaS products",
4-
"version": "9.0.1",
4+
"version": "9.1.0",
55
"license": "MIT",
66
"repository": {
77
"type": "git",

src/components/breadcrumbs/Breadcrumbs.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export const Default: StoryObj = {
4444
export const CustomComponent: StoryObj = {
4545
render: () => (
4646
<Breadcrumbs
47-
renderCustom={({ to }) => (
48-
<Button as="a" linkTo={to}>
47+
renderCustom={({ breadcrumb }) => (
48+
<Button as="a" linkTo={breadcrumb.uri}>
4949
test123
5050
</Button>
5151
)}

src/components/breadcrumbs/Breadcrumbs.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ export type BreadcrumbsListProps = {
1818
>;
1919
renderCustom?: (
2020
props: React.PropsWithChildren<{
21-
to: string;
22-
isDisabled?: boolean;
2321
css: FlattenSimpleInterpolation;
22+
breadcrumb: BreadcrumbsList;
2423
}>
2524
) => React.ReactNode;
2625
};
@@ -33,9 +32,8 @@ export function Breadcrumbs({ list, renderCustom }: BreadcrumbsListProps) {
3332
<li key={breadcrumb.label}>
3433
{renderCustom ? (
3534
renderCustom({
36-
isDisabled: breadcrumb.isDisabled,
3735
css: aStyles,
38-
to: breadcrumb.uri,
36+
breadcrumb,
3937
})
4038
) : (
4139
<StyledLink

0 commit comments

Comments
 (0)