Skip to content

Commit

Permalink
Merge pull request #1162 from jguthrie100/add_tooltips
Browse files Browse the repository at this point in the history
Include tooltips for menu actions
  • Loading branch information
tananaev authored Aug 17, 2023
2 parents f97f41c + 2e5c04d commit 73e2251
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
6 changes: 6 additions & 0 deletions modern/src/common/theme/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ export default {
},
},
},
MuiTooltip: {
defaultProps: {
enterDelay: 500,
enterNextDelay: 500,
},
},
};
5 changes: 4 additions & 1 deletion modern/src/other/GeofencesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useDispatch } from 'react-redux';
import {
Divider, Typography, IconButton, useMediaQuery, Toolbar,
} from '@mui/material';
import Tooltip from '@mui/material/Tooltip';
import makeStyles from '@mui/styles/makeStyles';
import { useTheme } from '@mui/material/styles';
import Drawer from '@mui/material/Drawer';
Expand Down Expand Up @@ -117,7 +118,9 @@ const GeofencesPage = () => {
<label htmlFor="upload-gpx">
<input accept=".gpx" id="upload-gpx" type="file" className={classes.fileInput} onChange={handleFile} />
<IconButton edge="end" component="span" onClick={() => {}}>
<UploadFileIcon />
<Tooltip title={t('sharedUpload')}>
<UploadFileIcon />
</Tooltip>
</IconButton>
</label>
</Toolbar>
Expand Down
1 change: 1 addition & 0 deletions modern/src/resources/l10n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"sharedLoading": "Loading...",
"sharedHide": "Hide",
"sharedSave": "Save",
"sharedUpload": "Upload",
"sharedSet": "Set",
"sharedCancel": "Cancel",
"sharedAdd": "Add",
Expand Down
25 changes: 16 additions & 9 deletions modern/src/settings/components/CollectionActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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.title} key={action.key}>
<IconButton size="small" onClick={() => handleCustom(action)}>
{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')}>
<IconButton size="small" onClick={handleEdit}>
<EditIcon fontSize="small" />
</IconButton>
</Tooltip>
<Tooltip title={t('sharedRemove')}>
<IconButton size="small" onClick={handleRemove}>
<DeleteIcon fontSize="small" />
</IconButton>
</Tooltip>
</>
)}
</div>
Expand Down

0 comments on commit 73e2251

Please sign in to comment.