Skip to content

Commit

Permalink
Changed color of selected row to a color that is easier to see
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Jordan Wright committed Nov 4, 2020
1 parent 989f148 commit 44865c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/ItemTable/ItemTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ export default function ItemTable({ data }) {
opacity: 0.2,
},
rowSelected: {
"&$selected, &$selected:hover": {
backgroundColor: theme.palette.primary,
},
backgroundColor: theme.palette.type === 'light' ? theme.palette.primary[100] : theme.palette.primary[600],
},
bandedRows: {
'&:nth-of-type(even)': {
Expand Down Expand Up @@ -134,8 +132,10 @@ export default function ItemTable({ data }) {
history.push(`/${row.original.queue}/${row.original.number}`);
setSelecetedRow({ queue: row.original.queue, number: row.original.number })
}}
// This functionality should be achieved by using the selected prop and
// overriding the selected class but this applied the secondary color at 0.08% opacity.
// Overridding the root class is a workaround.
classes={{ root: isSelected ? classes.rowSelected : classes.bandedRows }}
selected={selectedRow.queue === row.original.queue && selectedRow.number === row.original.number}
{...row.getRowProps()} >
{row.cells.map(cell => (
<TableCell classes={{ root: classes.columnBorders }} {...cell.getCellProps()}>
Expand Down

0 comments on commit 44865c2

Please sign in to comment.