Add tooltips to shortcuts
Signed-off-by: Philipp Hugenroth <philipph@spotify.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-shortcuts': patch
|
||||
---
|
||||
|
||||
Add tooltip to display shortcut title on hover. This should improve the readability of shortcuts with long names, which are cutoff by ellipsis.
|
||||
@@ -15,7 +15,9 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { IconButton, makeStyles } from '@material-ui/core';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import IconButton from '@material-ui/core/IconButton';
|
||||
import Tooltip from '@material-ui/core/Tooltip';
|
||||
import EditIcon from '@material-ui/icons/Edit';
|
||||
import { ShortcutIcon } from './ShortcutIcon';
|
||||
import { EditShortcut } from './EditShortcut';
|
||||
@@ -76,21 +78,23 @@ export const ShortcutItem = ({ shortcut, api }: Props) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<SidebarItem
|
||||
className={classes.root}
|
||||
to={shortcut.url}
|
||||
text={shortcut.title}
|
||||
icon={() => <ShortcutIcon text={text} color={color} />}
|
||||
>
|
||||
<IconButton
|
||||
id="edit"
|
||||
data-testid="edit"
|
||||
onClick={handleClick}
|
||||
className={classes.button}
|
||||
<Tooltip title={shortcut.title} enterDelay={500}>
|
||||
<SidebarItem
|
||||
className={classes.root}
|
||||
to={shortcut.url}
|
||||
text={shortcut.title}
|
||||
icon={() => <ShortcutIcon text={text} color={color} />}
|
||||
>
|
||||
<EditIcon className={classes.icon} />
|
||||
</IconButton>
|
||||
</SidebarItem>
|
||||
<IconButton
|
||||
id="edit"
|
||||
data-testid="edit"
|
||||
onClick={handleClick}
|
||||
className={classes.button}
|
||||
>
|
||||
<EditIcon className={classes.icon} />
|
||||
</IconButton>
|
||||
</SidebarItem>
|
||||
</Tooltip>
|
||||
<EditShortcut
|
||||
onClose={handleClose}
|
||||
anchorEl={anchorEl}
|
||||
|
||||
Reference in New Issue
Block a user