Add property to make breadcrumb not clickable (#1907)

Make breadcrumb not clickable with new property. This is useful to show the breadcrumb for path that does not exist yet.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
This commit is contained in:
Eduard Heimbuch
2022-01-05 14:30:14 +01:00
committed by GitHub
parent a756b86f77
commit 82ac06f896
4 changed files with 148 additions and 16 deletions

View File

@@ -49,8 +49,8 @@ const prefix = (
);
storiesOf("BreadCrumb", module)
.addDecorator((story) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
.addDecorator((storyFn) => <Wrapper>{storyFn()}</Wrapper>)
.addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
.addDecorator(storyFn => <Wrapper>{storyFn()}</Wrapper>)
.add("Default", () => (
<Breadcrumb
repository={repository}
@@ -87,4 +87,17 @@ storiesOf("BreadCrumb", module)
permalink={"/" + path}
preButtons={prefix}
/>
))
.add("Not clickable", () => (
<Breadcrumb
repository={repository}
defaultBranch={master}
branch={master}
path={path}
baseUrl={baseUrl}
sources={sources}
revision={"1"}
permalink={"/" + path}
clickable={false}
/>
));