Skip to content

Commit

Permalink
Add card tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Nov 17, 2024
1 parent 47ba0ab commit d855fb6
Showing 1 changed file with 43 additions and 32 deletions.
75 changes: 43 additions & 32 deletions src/common/components/StatusCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
CardMedia,
TableFooter,
Link,
Tooltip,
} from '@mui/material';
import makeStyles from '@mui/styles/makeStyles';
import CloseIcon from '@mui/icons-material/Close';
Expand Down Expand Up @@ -240,38 +241,48 @@ const StatusCard = ({ deviceId, position, onClose, disableActions, desktopPaddin
</CardContent>
)}
<CardActions classes={{ root: classes.actions }} disableSpacing>
<IconButton
color="secondary"
onClick={(e) => setAnchorEl(e.currentTarget)}
disabled={!position}
>
<PendingIcon />
</IconButton>
<IconButton
onClick={() => navigate('/replay')}
disabled={disableActions || !position}
>
<ReplayIcon />
</IconButton>
<IconButton
onClick={() => navigate(`/settings/device/${deviceId}/command`)}
disabled={disableActions}
>
<PublishIcon />
</IconButton>
<IconButton
onClick={() => navigate(`/settings/device/${deviceId}`)}
disabled={disableActions || deviceReadonly}
>
<EditIcon />
</IconButton>
<IconButton
color="error"
onClick={() => setRemoving(true)}
disabled={disableActions || deviceReadonly}
>
<DeleteIcon />
</IconButton>
<Tooltip title={t('sharedExtra')}>
<IconButton
color="secondary"
onClick={(e) => setAnchorEl(e.currentTarget)}
disabled={!position}
>
<PendingIcon />
</IconButton>
</Tooltip>
<Tooltip title={t('reportReplay')}>
<IconButton
onClick={() => navigate('/replay')}
disabled={disableActions || !position}
>
<ReplayIcon />
</IconButton>
</Tooltip>
<Tooltip title={t('commandTitle')}>
<IconButton
onClick={() => navigate(`/settings/device/${deviceId}/command`)}
disabled={disableActions}
>
<PublishIcon />
</IconButton>
</Tooltip>
<Tooltip title={t('sharedEdit')}>
<IconButton
onClick={() => navigate(`/settings/device/${deviceId}`)}
disabled={disableActions || deviceReadonly}
>
<EditIcon />
</IconButton>
</Tooltip>
<Tooltip title={t('sharedRemove')}>
<IconButton
color="error"
onClick={() => setRemoving(true)}
disabled={disableActions || deviceReadonly}
>
<DeleteIcon />
</IconButton>
</Tooltip>
</CardActions>
</Card>
</Draggable>
Expand Down

0 comments on commit d855fb6

Please sign in to comment.