mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Fix remaining a11y issues (#43420)
* add aria labels * reverting * chore: revert yarn.lock Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
This commit is contained in:
@@ -27,17 +27,24 @@ export const ActionIcon: FC<Props> = ({
|
||||
tooltipPlacement = 'top',
|
||||
...rest
|
||||
}) => {
|
||||
const ariaLabel = typeof tooltip === 'string' ? tooltip : undefined;
|
||||
const iconEl = (
|
||||
<Icon role="button" className={cx(useStyles(getStyle), className)} onClick={onClick} name={icon} {...rest} />
|
||||
<Icon
|
||||
role="button"
|
||||
className={cx(useStyles(getStyle), className)}
|
||||
onClick={onClick}
|
||||
name={icon}
|
||||
{...rest}
|
||||
aria-label={ariaLabel}
|
||||
/>
|
||||
);
|
||||
|
||||
const ariaLabel = typeof tooltip === 'string' ? tooltip : undefined;
|
||||
return (
|
||||
<Tooltip content={tooltip} placement={tooltipPlacement}>
|
||||
{(() => {
|
||||
if (to) {
|
||||
return (
|
||||
<Link aria-label={ariaLabel} to={to} target={target}>
|
||||
<Link to={to} target={target}>
|
||||
{iconEl}
|
||||
</Link>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user