ColumnFilterButton correction and table DOM structure correction

This commit is contained in:
Mateusz Tylka 2023-08-11 13:10:56 +02:00
parent 6c4da8c181
commit 836ec0aef2
5 changed files with 49 additions and 46 deletions

View File

@ -8,6 +8,7 @@ import RowsBackgroundStyle from '../../styles/RowsBackgroundStyle';
const DesktopTable = (props) => { const DesktopTable = (props) => {
return ( return (
<TableStyle rowFooter={props.rowFooter}> <TableStyle rowFooter={props.rowFooter}>
<tbody>
<TableHeader <TableHeader
orderedKeys={props.orderedKeys} orderedKeys={props.orderedKeys}
sortByUpdate={props.sortByUpdate} sortByUpdate={props.sortByUpdate}
@ -16,7 +17,11 @@ const DesktopTable = (props) => {
{props.elements.map((item, i) => { {props.elements.map((item, i) => {
return ( return (
<tr key={`table-row-${i}`} className="TableStyle__tr"> <tr key={`table-row-${i}`} className="TableStyle__tr">
<TableRowItems orderedKeys={props.orderedKeys} item={item} i={i} /> <TableRowItems
orderedKeys={props.orderedKeys}
item={item}
i={i}
/>
<TableRowFooter <TableRowFooter
deleteItem={() => { deleteItem={() => {
props.setItemToHandle(item); props.setItemToHandle(item);
@ -30,10 +35,11 @@ const DesktopTable = (props) => {
item={item} item={item}
i={i} i={i}
/> />
<RowsBackgroundStyle i={i} /> <RowsBackgroundStyle i={i} as="td" />
</tr> </tr>
); );
})} })}
</tbody>
</TableStyle> </TableStyle>
); );
}; };

View File

@ -25,6 +25,7 @@ const TableHeader = (props) => {
props.tableUpdate(); props.tableUpdate();
}} }}
> >
<FlexRow as="span" alignmentX="flex-start" gap="8px" width="100%">
{keyValue} {keyValue}
<FlexRow <FlexRow
as="span" as="span"
@ -37,6 +38,7 @@ const TableHeader = (props) => {
rotateIcon={rotateActiveIcon} rotateIcon={rotateActiveIcon}
/> />
</FlexRow> </FlexRow>
</FlexRow>
</th> </th>
); );
})} })}

View File

@ -21,7 +21,9 @@ const TableRowItems = ({ orderedKeys, item, i }) => {
return ( return (
<td key={`table-item-${i}-${j}`} className="TableStyle__td"> <td key={`table-item-${i}-${j}`} className="TableStyle__td">
{IS_MOBILE() && ( {IS_MOBILE() && (
<Container className="mobile-table-header">{keyValue}</Container> <Container as="span" className="mobile-table-header">
{keyValue}
</Container>
)} )}
{renderValue(keyValue)} {renderValue(keyValue)}
{keyValue === '#' && i + 1} {keyValue === '#' && i + 1}

View File

@ -3,7 +3,7 @@ import { FlexRow } from '../../../../../utils/containers';
const TableRowTags = ({ item, i }) => { const TableRowTags = ({ item, i }) => {
return ( return (
<FlexRow className="TableStyle__tags-container"> <FlexRow as="span" className="TableStyle__tags-container">
{renderTags(item.tags)} {renderTags(item.tags)}
</FlexRow> </FlexRow>
); );

View File

@ -6,7 +6,6 @@ const TableStyle = styled.table`
width: 100%; width: 100%;
.TableStyle__th { .TableStyle__th {
position: relative;
cursor: pointer; cursor: pointer;
* { * {
cursor: pointer; cursor: pointer;
@ -62,12 +61,6 @@ const TableStyle = styled.table`
gap: 4px; gap: 4px;
padding: 0 2px; padding: 0 2px;
} }
.TableStyle__sort-button {
position: absolute;
top: 15px;
right: 16%;
}
`; `;
export default TableStyle; export default TableStyle;