diff --git a/client/src/Components/design-elements/Table.tsx b/client/src/Components/design-elements/Table.tsx index 0389f4fef..8bf2d46f3 100644 --- a/client/src/Components/design-elements/Table.tsx +++ b/client/src/Components/design-elements/Table.tsx @@ -52,11 +52,6 @@ type DataTableProps = emptyViewText?: string; emptyViewPositive?: boolean; getRowSx?: (row: T) => SxProps; - /** - * Marks a row selected so it gets the shared selected + hover treatment. - * Desktop table only - the small-screen card branch does not style - * selection yet, same as `getRowSx`. - */ isRowSelected?: (row: T) => boolean; }; @@ -220,21 +215,6 @@ export function DataTable< "& .MuiTableBody-root .MuiTableRow-root:last-child .MuiTableCell-root": { borderBottom: "none", }, - // Cells paint `background.paper`, so a background set on the row - // never shows. Selection and hover both have to be applied at - // cell level, and selection has to come first so hover layers - // on top of it rather than replacing it. - "& .MuiTableBody-root .MuiTableRow-root.is-selected .MuiTableCell-root": { - backgroundColor: theme.palette.action.selected, - }, - "& .MuiTableBody-root .MuiTableRow-root.is-clickable:hover .MuiTableCell-root": - { - backgroundColor: theme.palette.action.rowHover, - }, - "& .MuiTableBody-root .MuiTableRow-root.is-selected.is-clickable:hover .MuiTableCell-root": - { - backgroundColor: theme.palette.action.selectedHover, - }, }} > @@ -255,18 +235,25 @@ export function DataTable< {data.map((row) => { const key = row.id || row._id || Math.random(); const isExpanded = expanded === key; + const selected = isRowSelected?.(row); return ( {