From 63ee7cd48eeec1826224d4e3dc38cea30b8a65bd Mon Sep 17 00:00:00 2001 From: Iacopo Leardini Date: Wed, 7 Aug 2024 10:59:04 +0200 Subject: [PATCH] Revert "feat: conditional rendering title in TableRow component" This reverts commit 152aa431a7645d050d956ce13386e83bdd453a0b. --- src/stories/table/TableRow.tsx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/stories/table/TableRow.tsx b/src/stories/table/TableRow.tsx index bab43fb..23c475a 100644 --- a/src/stories/table/TableRow.tsx +++ b/src/stories/table/TableRow.tsx @@ -29,7 +29,7 @@ interface CellProps { const Cell = ({ data, col }: CellProps) => { useWindowSize(); const isDesktop = window.matchMedia( - `only screen and (min-width: ${aqBootstrapTheme.grid.breakpoints.lg})`, + `only screen and (min-width: ${aqBootstrapTheme.grid.breakpoints.lg})` ).matches; const content = typeof data === "object" && "content" in data @@ -43,11 +43,7 @@ const Cell = ({ data, col }: CellProps) => {
{content}
) : ( <> - {!!col.title && ( - <> - {col.title}:{" "} - - )} + {col.title}:{" "} {content} )} @@ -74,7 +70,7 @@ const Element = styled.div` : `max-height: max-content; height: 100%; `} - } + } ; `; const CardStyle = styled.div` @@ -210,7 +206,7 @@ export const TableRow = ({ > - ), + ) )} {columns.map( @@ -221,7 +217,7 @@ export const TableRow = ({ data={dataRow[col.dataIndex]} col={col} /> - ), + ) )} @@ -247,7 +243,7 @@ export const TableRow = ({ > - ), + ) )} {columns.map( @@ -256,7 +252,7 @@ export const TableRow = ({
{dataRow[col.dataIndex] as React.ReactNode}
- ), + ) )}
{columns.map( @@ -265,14 +261,14 @@ export const TableRow = ({ - ), + ) )} ); }; return window.matchMedia( - `only screen and (min-width: ${aqBootstrapTheme.grid.breakpoints.lg})`, + `only screen and (min-width: ${aqBootstrapTheme.grid.breakpoints.lg})` ).matches ? ( ) : !mobileAlternative ? (