fix(client): add hover states to tables, cards, stat boxes and icon buttons
Clickable surfaces across the app set `cursor: pointer` but gave no visual response on hover, so rows and cards read as static text. Two separate causes: - `DataTable` never passed MUI's opt-in `hover` prop on `TableRow`, which is `false` by default, so no table in the app shaded on hover. One change here covers all 16 page tables (Uptime, Incidents, Tags, Team, Notifications, Maintenance, Proxies, Status pages, Checks, Geo checks, Infrastructure, PageSpeed and the three Logs tables). - `IconButton` gates its hover style behind `props => !props.disableRipple`, and the theme sets `disableRipple: true` globally, so the row action gear and the pagination arrows lost their background. `MenuItem` is unaffected — its hover sits on the base style — so action menu items already worked and are left alone. Adds a `HOVER.ROW` (0.025) constant and an `action.rowHover` palette token, defined in both light and dark palettes so the overlay direction is correct on each surface. Kept separate from MUI's shared `action.hover` so menu items, which read that token, are not restyled as a side effect. Also fixes `cursor` on expandable rows, which showed `default` despite being clickable to expand. Claude-Session: https://claude.ai/code/session_01AbYLvwpEaZFXktHVcqrFRd
This commit is contained in:
1 parent
46211ac61d
commit
9a6602b9e1
6 files changed
+55
-5
No files matched your search
@@ -64,7 +64,12 @@ export const StatBox = ({
|
||||
palette={palette}
|
||||
sx={{
|
||||
...(sx as object),
|
||||
...(onClick ? { cursor: "pointer", "&:hover": { opacity: 0.95 } } : {}),
|
||||
...(onClick
|
||||
? {
|
||||
cursor: "pointer",
|
||||
"&:hover": { backgroundColor: theme.palette.action.rowHover },
|
||||
}
|
||||
: {}),
|
||||
}}
|
||||
>
|
||||
<Stack onClick={onClick}>
|
||||
|
||||
@@ -108,6 +108,11 @@ export function DataTable<
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
padding: theme.spacing(LAYOUT.XS),
|
||||
cursor: onRowClick ? "pointer" : "default",
|
||||
...(onRowClick && {
|
||||
"&:hover": {
|
||||
backgroundColor: theme.palette.action.rowHover,
|
||||
},
|
||||
}),
|
||||
}}
|
||||
key={key}
|
||||
>
|
||||
@@ -207,6 +212,10 @@ export function DataTable<
|
||||
"& .MuiTableBody-root .MuiTableRow-root:last-child .MuiTableCell-root": {
|
||||
borderBottom: "none",
|
||||
},
|
||||
"& .MuiTableBody-root .MuiTableRow-root.is-clickable:hover .MuiTableCell-root":
|
||||
{
|
||||
backgroundColor: theme.palette.action.rowHover,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<TableHead>
|
||||
@@ -231,8 +240,9 @@ export function DataTable<
|
||||
return (
|
||||
<Fragment key={key}>
|
||||
<TableRow
|
||||
className={onRowClick || expandableRows ? "is-clickable" : undefined}
|
||||
sx={{
|
||||
cursor: onRowClick ? "pointer" : "default",
|
||||
cursor: onRowClick || expandableRows ? "pointer" : "default",
|
||||
...(getRowSx?.(row) as object),
|
||||
}}
|
||||
onClick={() => {
|
||||
@@ -314,7 +324,13 @@ function TablePaginationActions(props: TablePaginationActionsProps) {
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{ flexShrink: 0, ml: { xs: 0, md: 2.5 } }}
|
||||
sx={{
|
||||
flexShrink: 0,
|
||||
ml: { xs: 0, md: 2.5 },
|
||||
"& .MuiIconButton-root:not(.Mui-disabled):hover": {
|
||||
backgroundColor: theme.palette.action.rowHover,
|
||||
},
|
||||
}}
|
||||
className="table-pagination-actions"
|
||||
>
|
||||
<IconButton
|
||||
@@ -412,7 +428,13 @@ function HasMoreTablePaginationActions(props: HasMoreTablePaginationActionsProps
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{ flexShrink: 0, ml: { xs: 0, md: 2.5 } }}
|
||||
sx={{
|
||||
flexShrink: 0,
|
||||
ml: { xs: 0, md: 2.5 },
|
||||
"& .MuiIconButton-root:not(.Mui-disabled):hover": {
|
||||
backgroundColor: theme.palette.action.rowHover,
|
||||
},
|
||||
}}
|
||||
className="table-pagination-actions"
|
||||
>
|
||||
<IconButton
|
||||
|
||||
Reference in new issue
Block a user