mirror of
https://github.com/apotdevin/thunderhub.git
synced 2025-02-21 22:11:37 +01:00
* feat: initial nextjs commit * chore: general card styles changes * chore: add storybook * chore: small changes and fixes * fix: trading filter encoding * fix: add link to node * chore: set to correct version
35 lines
982 B
JavaScript
35 lines
982 B
JavaScript
import React from 'react';
|
|
import styled, { ThemeProvider, css } from 'styled-components';
|
|
import { select, boolean } from '@storybook/addon-knobs';
|
|
import { backgroundColor, cardColor } from '../src/styles/Themes';
|
|
|
|
const StyledBackground = styled.div`
|
|
width: 100%;
|
|
height: 100%;
|
|
padding: 100px 0;
|
|
${({ withBackground, cardBackground }) =>
|
|
withBackground &&
|
|
css`
|
|
background: ${cardBackground ? cardColor : backgroundColor};
|
|
`}
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
`;
|
|
|
|
const ThemeDecorator = storyFn => {
|
|
const background = boolean('No Background', false);
|
|
const cardBackground = boolean('Card Background', true);
|
|
return (
|
|
<ThemeProvider theme={{ mode: select('Theme', ['dark', 'light'], 'dark') }}>
|
|
<StyledBackground
|
|
withBackground={!background}
|
|
cardBackground={cardBackground}
|
|
>
|
|
{storyFn()}
|
|
</StyledBackground>
|
|
</ThemeProvider>
|
|
);
|
|
};
|
|
|
|
export default ThemeDecorator;
|