move router decorator into stories

This makes it possible to define other routes that "/" inside each story.
This commit is contained in:
Sebastian Sdorra
2020-03-30 15:01:51 +02:00
parent 2ab2079e07
commit 23f4c3cba9
5 changed files with 8 additions and 3 deletions

View File

@@ -32,6 +32,7 @@ import { Binder, BinderContext } from "@scm-manager/ui-extensions";
import { Repository } from "@scm-manager/ui-types";
import Image from "../Image";
import Icon from "../Icon";
import {MemoryRouter} from "react-router-dom";
const baseDate = "2020-03-26T12:13:42+02:00";
@@ -74,6 +75,7 @@ const QuickLink = (
);
storiesOf("RepositoryEntry", module)
.addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
.addDecorator(storyFn => <Container>{storyFn()}</Container>)
.add("Default", () => {
return <RepositoryEntry repository={repository} baseDate={baseDate} />;