Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ const StyledTable = styled(Table)<{
}
}

.ant-table-row.table-row-highlighted > td.ant-table-cell,
.ant-table-row.table-row-highlighted > td.ant-table-cell.ant-table-cell-row-hover {
background-color: ${theme.colorPrimaryBg};
}

.ant-table-cell {
max-width: 320px;
font-feature-settings: 'tnum' 1;
Expand Down Expand Up @@ -155,6 +160,7 @@ function TableCollection<T extends object>({
columns,
rows,
loading,
highlightRowId,
setSortBy,
headerGroups,
columnsForWrapText,
Expand Down Expand Up @@ -272,6 +278,12 @@ function TableCollection<T extends object>({
onPageChange,
]);

const getRowClassName = useCallback(
(record: Record<string, unknown>) =>
record?.id === highlightRowId ? 'table-row-highlighted' : '',
[highlightRowId],
);

return (
<StyledTable
loading={loading}
Expand All @@ -289,6 +301,7 @@ function TableCollection<T extends object>({
sortDirections={['ascend', 'descend', 'ascend']}
isPaginationSticky={isPaginationSticky}
showRowCount={showRowCount}
rowClassName={getRowClassName}
components={{
header: {
cell: (props: HTMLAttributes<HTMLTableCellElement>) => (
Expand Down
Loading