safe-react/.storybook/preview.js

27 lines
766 B
JavaScript
Raw Permalink Normal View History

New layout (#1201) * Adding storybook * new layout components * add preview body * add styles * extract walletInfo to a separated component * remove unused component * New Layout componentes refactor * Return type in Root * change story name * adding back OpenHoc * sort import * fix margins * split layout * Move Layout related components to /components/SidebarLayout * Adding new layout for real * Some changes and refactor * Move Modals from safe to sidebar * move safeAddress logic from safe to sidebar * move safe container from components * List refactor * sidebar navigation * selected item * list selected example * add styles * add text component to new tx button * Sidebar without walletInfo * fix footer and body margins * add logo Safe Multisig * update safe-react-components * List colors and List Icon * fix subItem * update safe-react-components * fix logo margin, add notConnected icon and badge Read Only * fix merge problems * add sidebar styles and icon notConnected * fix readOnly * fix QR tooltip info * add Help Center link and fix margins * Remove 'No safe loaded' text * review changes * fix import * fix Help center margin * add styles to address * replace empty div with FlexSpacer component * rename Sidebar by SafeListSidebar * fix load and create safe position (top-left) * Add comment to FlexSpacer * fix Title margin Safe Creation Progress * fix Read Only line-height * review fixes * review fixes * rename component * fix Help Center styles * return type in DefaultBadge * Fix types for list component (still wip) * move sidebarList to a hook * fix safe route container * fix src version * fix list typescript issue * rename sidebarlayout to applayout * sidebar fixes wip * sidebar fixes wip * remove unused function * lift sidebar items state up * fix broken imports * remove unused files Co-authored-by: Agustín Longoni <agustin.longoni@altoros.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> Co-authored-by: Mikhail Mikheev <mmvsha73@gmail.com>
2020-08-27 14:53:28 +00:00
import React from 'react'
import { MemoryRouter } from 'react-router-dom'
import { addDecorator } from '@storybook/react'
import { ThemeProvider, createGlobalStyle } from 'styled-components'
import { theme } from '@gnosis.pm/safe-react-components'
import averta from 'src/assets/fonts/Averta-normal.woff2'
import avertaBold from 'src/assets/fonts/Averta-ExtraBold.woff2'
const GlobalStyles = createGlobalStyle`
@font-face {
font-family: 'Averta';
src: local('Averta'), local('Averta Bold'),
url(${averta}) format('woff2'),
url(${avertaBold}) format('woff');
}
`
addDecorator((storyFn) => (
<ThemeProvider theme={theme}>
<MemoryRouter>
<GlobalStyles />
{storyFn()}
</MemoryRouter>
</ThemeProvider>
))