Files
twenty/front/src/testing/ComponentStorybookLayout.tsx
gitstart-twenty 612bd57d5b Write Storybook tests for front/src/modules/ui/field/meta-types/display components (#1932)
* Write Storybook tests for front/src/modules/ui/field/meta-types/display components

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: FellipeMTX <fellipefacdir@gmail.com>

* Write Storybook tests for front/src/modules/ui/field/meta-types/display components

Co-authored-by: FellipeMTX <fellipefacdir@gmail.com>
Co-authored-by: v1b3m <vibenjamin6@gmail.com>

* Write Storybook tests for front/src/modules/ui/field/meta-types/display components

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: FellipeMTX <fellipefacdir@gmail.com>

* add EllipsisDisplay component

* add EllipsisDisplay component

* modified ComponentDecorator to pass a minWidth parameter to test ellipsis

* add ellipsis test to all components

* add ellipsis to links

* removed minWidth and set it to 'unset' if the width is not defined

---------

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: FellipeMTX <fellipefacdir@gmail.com>
Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
2023-10-10 12:39:19 +02:00

29 lines
729 B
TypeScript

import styled from '@emotion/styled';
const StyledLayout = styled.div<{ width?: number }>`
background: ${({ theme }) => theme.background.primary};
border: 1px solid ${({ theme }) => theme.border.color.light};
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>
);