preview.js 871 B

123456789101112131415161718192021222324252627282930313233343536
  1. import React from "react";
  2. import { addDecorator } from "@storybook/react";
  3. import styled, { createGlobalStyle } from "styled-components";
  4. import { ThemePalette, ThemeProps } from "@src/components/Theme";
  5. import Fonts from "@src/components/ui/Fonts";
  6. import { BrowserRouter as Router, Switch } from "react-router";
  7. const Wrapper = styled.div`
  8. display: inline-block;
  9. background: ${ThemePalette.grayscale[7]};
  10. padding: 32px;
  11. `;
  12. const GlobalStyle = createGlobalStyle`
  13. ${Fonts}
  14. body {
  15. color: ${ThemePalette.black};
  16. font-family: Rubik;
  17. font-size: 14px;
  18. font-weight: ${ThemeProps.fontWeights.regular};
  19. -webkit-font-smoothing: antialiased;
  20. -moz-osx-font-smoothing: grayscale;
  21. }
  22. `;
  23. addDecorator(storyFn => (
  24. <Router>
  25. <Switch>
  26. <Wrapper>
  27. <GlobalStyle />
  28. {storyFn()}
  29. </Wrapper>
  30. </Switch>
  31. </Router>
  32. ));