Skip to content

Commit eed2b26

Browse files
committed
tab through highlight color now works in light and dark mode
1 parent bef524e commit eed2b26

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/frontend/src/pages/FinancePage/ReimbursementRequestForm/ReimbursementProductTable.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { ReimbursementProductCreateArgs, validateWBS, wbsPipe } from 'shared';
2525
import { Add, Delete } from '@mui/icons-material';
2626
import { Control, Controller, FieldErrors, UseFormSetValue } from 'react-hook-form';
2727
import { ReimbursementRequestFormInput } from './ReimbursementRequestForm';
28+
import { useTheme } from '@mui/system';
2829

2930
interface ReimbursementProductTableProps {
3031
reimbursementProducts: ReimbursementProductCreateArgs[];
@@ -74,6 +75,9 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({
7475
setValue(`reimbursementProducts.${index}.cost`, parseFloat(value.toFixed(2)));
7576
};
7677

78+
const userTheme = useTheme();
79+
const hoverColor = userTheme.palette.action.hover;
80+
7781
return (
7882
<TableContainer>
7983
<Table>
@@ -147,7 +151,7 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({
147151
<IconButton
148152
sx={{
149153
'&:focus': {
150-
backgroundColor: '#f5f5f5'
154+
backgroundColor: hoverColor
151155
}
152156
}}
153157
onClick={() => removeProduct(product.index)}
@@ -162,7 +166,10 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({
162166
sx={{
163167
margin: '4px',
164168
'&:focus': {
165-
backgroundColor: '#fdf8f8'
169+
backgroundColor: hoverColor
170+
},
171+
'&:hover': {
172+
backgroundColor: hoverColor
166173
}
167174
}}
168175
startIcon={<Add />}

0 commit comments

Comments
 (0)