Skip to content

Commit

Permalink
feat(table): fixs from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
malegreIndec committed Feb 5, 2024
1 parent c07b7b0 commit ab12aec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
5 changes: 2 additions & 3 deletions src/components/Table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ const Table = ({
<Tr key={row?.key} {...row?.containerStyle} data-testid={`row-${row?.key}`}>
{columnsData.map(header => {
const isEmpty = row[header.key] == null || row[header.key] === '';
const rowsStyle = isEmpty && paintFreeRowsColor !== undefined
? {backgroundColor: `${paintFreeRowsColor}`} : (row.style || '');
const updatRowsStyle = isEmpty ? header.emptyRow : header.tdStyle;
return (
<Td key={`${row.key}-${header.key}`} {...rowsStyle} {...header.tdStyle}>
<Td key={`${row.key}-${header.key}`} {...row.style} {...updatRowsStyle}>
{row[header.key]}
</Td>
);
Expand Down
28 changes: 0 additions & 28 deletions src/theme/components/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,6 @@ const table = {
textAlign: 'left',
padding: '10px 20px'
}
},
fixedFirstColumn: {
fontSize: '16px',
height: '35px',
table: {
background: 'white',
borderRadius: '0 0 10px 10px'
},
tr: {
'& th:first-of-type': {
position: 'sticky',
left: '0',
backgroundColor: 'white'
},
'&:nth-of-type(even) td:first-of-type ': {
backgroundColor: 'brand.neutral50'
},
'&:nth-of-type(odd) td:first-of-type ': {
backgroundColor: 'white'
}
},

td: {
'&:first-of-type': {
position: 'sticky',
left: '0'
}
}
}
}
};
Expand Down

0 comments on commit ab12aec

Please sign in to comment.