preview has now also a dark background & added a one click change theme button <img width="994" alt="Bildschirmfoto 2024-04-06 um 18 27 45" src="https://github.com/twentyhq/twenty/assets/48770548/95f12617-e48f-4492-9b51-13410aff43ee">
27 lines
607 B
TypeScript
27 lines
607 B
TypeScript
import styled from '@emotion/styled';
|
|
|
|
const StyledLayout = styled.div<{ width?: number }>`
|
|
border-radius: 5px;
|
|
|
|
display: flex;
|
|
flex-direction: row;
|
|
|
|
height: fit-content;
|
|
max-width: calc(100% - 40px);
|
|
min-width: ${({ width }) => (width ? 'unset' : '300px')};
|
|
padding: 20px;
|
|
width: ${({ width }) => (width ? width + 'px' : 'fit-content')};
|
|
`;
|
|
|
|
type ComponentStorybookLayoutProps = {
|
|
width?: number;
|
|
children: JSX.Element;
|
|
};
|
|
|
|
export const ComponentStorybookLayout = ({
|
|
width,
|
|
children,
|
|
}: ComponentStorybookLayoutProps) => (
|
|
<StyledLayout width={width}>{children}</StyledLayout>
|
|
);
|