Created
January 1, 2020 07:04
-
-
Save oakfang/ea417dae1803f4ca4a1089b194a888ff to your computer and use it in GitHub Desktop.
center decorator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { configure, addDecorator } from "@storybook/react"; | |
import styled from "styled-components"; | |
import { MemoryRouter } from "react-router-dom"; | |
import { ThemeService } from "services/theme"; | |
const Center = styled.div` | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
height: 100vh; | |
width: 100vw; | |
`; | |
addDecorator(story => ( | |
<MemoryRouter> | |
<ThemeService> | |
<Center>{story()}</Center> | |
</ThemeService> | |
</MemoryRouter> | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment