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

@@ -33,6 +33,7 @@ import hitchhiker from "../__resources__/hitchhiker.png";
import marvin from "../__resources__/marvin.jpg";
import NavLink from "../navigation/NavLink";
import ExternalLink from "../navigation/ExternalLink";
import {MemoryRouter} from "react-router-dom";
const trillian: Me = {
name: "trillian",
@@ -64,6 +65,7 @@ const withBinder = (binder: Binder) => {
};
storiesOf("Layout|Footer", module)
.addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
.add("Default", () => {
return <Footer me={trillian} version="2.0.0" links={{}} />;
})