aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/components
diff options
context:
space:
mode:
authorJamie Guthrie <jamie.guthrie@gmail.com>2023-08-16 18:58:52 +0200
committerJamie Guthrie <jamie.guthrie@gmail.com>2023-08-16 18:58:52 +0200
commit62ae7d516525bba2c2d053832ece7d613be86dc9 (patch)
tree0981f89ddc1386e1021a77b2e933e176423fe995 /modern/src/settings/components
parent348b8ea777ed7695f50db430fbff6a1c59938c54 (diff)
downloadtrackermap-web-62ae7d516525bba2c2d053832ece7d613be86dc9.tar.gz
trackermap-web-62ae7d516525bba2c2d053832ece7d613be86dc9.tar.bz2
trackermap-web-62ae7d516525bba2c2d053832ece7d613be86dc9.zip
Add tooltips
Diffstat (limited to 'modern/src/settings/components')
-rw-r--r--modern/src/settings/components/CollectionActions.js27
1 files changed, 17 insertions, 10 deletions
diff --git a/modern/src/settings/components/CollectionActions.js b/modern/src/settings/components/CollectionActions.js
index 177295b1..bf8eb257 100644
--- a/modern/src/settings/components/CollectionActions.js
+++ b/modern/src/settings/components/CollectionActions.js
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
import {
IconButton, Menu, MenuItem, useMediaQuery, useTheme,
} from '@mui/material';
+import Tooltip from '@mui/material/Tooltip';
import MoreVertIcon from '@mui/icons-material/MoreVert';
import EditIcon from '@mui/icons-material/Edit';
import DeleteIcon from '@mui/icons-material/Delete';
@@ -17,7 +18,7 @@ const useStyles = makeStyles(() => ({
}));
const CollectionActions = ({
- itemId, editPath, endpoint, setTimestamp, customActions, readonly,
+ itemId, editPath, endpoint, collectionTitle, setTimestamp, customActions, readonly,
}) => {
const theme = useTheme();
const classes = useStyles();
@@ -73,18 +74,24 @@ const CollectionActions = ({
) : (
<div className={classes.row}>
{customActions && customActions.map((action) => (
- <IconButton size="small" onClick={() => handleCustom(action)} key={action.key}>
- {action.icon}
- </IconButton>
+ <Tooltip title={action.tooltip} enterDelay={500} enterNextDelay={500}>
+ <IconButton size="small" onClick={() => handleCustom(action)} key={action.key}>
+ {action.icon}
+ </IconButton>
+ </Tooltip>
))}
{!readonly && (
<>
- <IconButton size="small" onClick={handleEdit}>
- <EditIcon fontSize="small" />
- </IconButton>
- <IconButton size="small" onClick={handleRemove}>
- <DeleteIcon fontSize="small" />
- </IconButton>
+ <Tooltip title={t('sharedEdit').concat(' ').concat(collectionTitle || '')} enterDelay={500} enterNextDelay={500}>
+ <IconButton size="small" onClick={handleEdit}>
+ <EditIcon fontSize="small" />
+ </IconButton>
+ </Tooltip>
+ <Tooltip title={t('sharedRemove').concat(' ').concat(collectionTitle || '')} enterDelay={500} enterNextDelay={500}>
+ <IconButton size="small" onClick={handleRemove}>
+ <DeleteIcon fontSize="small" />
+ </IconButton>
+ </Tooltip>
</>
)}
</div>