Skip to content

Commit

Permalink
refactor(story): Update storybook wrapper
Browse files Browse the repository at this point in the history
`storybook` provides a `decorators` object to let
us wrap components rendered in `storybook` with
some HTML.

This change wraps every component in a centered
flex box which is a nicer UX than the top left.

It also adds `MemoryRouter` which is required to
merge #69.
  • Loading branch information
tulup-conner committed May 1, 2022
1 parent 538a9f5 commit f7015e3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { MemoryRouter } from 'react-router-dom';
import Style from './style';

export const decorators = [
(Story) => (
<>
<MemoryRouter initialEntries={['/']}>
<Style />
<Story />
</>
<div className="flex h-screen items-center justify-center">
<div>
<Story />
</div>
</div>
</MemoryRouter>
),
];

Expand Down

0 comments on commit f7015e3

Please sign in to comment.