From 0844490c134101f1030273bfe5fef040e27e681a Mon Sep 17 00:00:00 2001 From: Sammy Teillet Date: Wed, 19 Apr 2023 15:13:26 +0200 Subject: [PATCH] feature: wrap all elements in a cell --- .../HorizontalyAlignedContainer.tsx | 2 +- front/src/pages/people/People.tsx | 57 ++++++++++--------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/front/src/layout/containers/HorizontalyAlignedContainer.tsx b/front/src/layout/containers/HorizontalyAlignedContainer.tsx index 6892b2fa3..1e0f63dc1 100644 --- a/front/src/layout/containers/HorizontalyAlignedContainer.tsx +++ b/front/src/layout/containers/HorizontalyAlignedContainer.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; type OwnProps = { - children: JSX.Element[]; + children: JSX.Element[] | JSX.Element; }; const StyledContainer = styled.div` diff --git a/front/src/pages/people/People.tsx b/front/src/pages/people/People.tsx index edd55f15f..1be1a401a 100644 --- a/front/src/pages/people/People.tsx +++ b/front/src/pages/people/People.tsx @@ -123,9 +123,11 @@ const columns = [ columnHelper.accessor('email', { header: () => , cell: (props) => ( - - {props.row.original.email} - + + + {props.row.original.email} + + ), }), columnHelper.accessor('company', { @@ -142,41 +144,44 @@ const columns = [ columnHelper.accessor('phone', { header: () => , cell: (props) => ( - - {parsePhoneNumber( - props.row.original.phone, - props.row.original.countryCode as CountryCode, - )?.formatInternational() || props.row.original.phone} - + + + {parsePhoneNumber( + props.row.original.phone, + props.row.original.countryCode as CountryCode, + )?.formatInternational() || props.row.original.phone} + + ), }), columnHelper.accessor('creationDate', { header: () => , - cell: (props) => - new Intl.DateTimeFormat(undefined, { - month: 'short', - day: 'numeric', - year: 'numeric', - }).format(props.row.original.creationDate), + cell: (props) => ( + + {new Intl.DateTimeFormat(undefined, { + month: 'short', + day: 'numeric', + year: 'numeric', + }).format(props.row.original.creationDate)} + + ), }), columnHelper.accessor('pipe', { header: () => , cell: (props) => ( - - - + {props.row.original.pipe.name} ), }), columnHelper.accessor('city', { header: () => , + cell: (props) => ( + {props.row.original.city} + ), }), ];