Skip to content

Commit

Permalink
Allow MenuItemLink to receive TooltipPops
Browse files Browse the repository at this point in the history
  • Loading branch information
asvarcas authored and djhi committed Jan 19, 2021
1 parent 037f75b commit 15cd871
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/ra-ui-materialui/src/layout/MenuItemLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { StaticContext } from 'react-router';
import { NavLink, NavLinkProps } from 'react-router-dom';
import MenuItem, { MenuItemProps } from '@material-ui/core/MenuItem';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import Tooltip from '@material-ui/core/Tooltip';
import Tooltip, { TooltipProps } from '@material-ui/core/Tooltip';
import { makeStyles } from '@material-ui/core/styles';

const NavLinkRef = forwardRef<HTMLAnchorElement, NavLinkProps>((props, ref) => (
Expand Down Expand Up @@ -40,6 +40,7 @@ const MenuItemLink: FC<MenuItemLinkProps> = forwardRef((props, ref) => {
leftIcon,
onClick,
sidebarIsOpen,
tooltipProps,
...rest
} = props;
const classes = useStyles(props);
Expand Down Expand Up @@ -78,7 +79,7 @@ const MenuItemLink: FC<MenuItemLinkProps> = forwardRef((props, ref) => {
}

return (
<Tooltip title={primaryText} placement="right">
<Tooltip title={primaryText} placement="right" {...tooltipProps}>
{renderMenuItem()}
</Tooltip>
);
Expand All @@ -89,6 +90,7 @@ interface Props {
primaryText?: ReactNode;
staticContext?: StaticContext;
sidebarIsOpen: boolean;
tooltipProps?: TooltipProps;
}

export type MenuItemLinkProps = Props &
Expand Down

0 comments on commit 15cd871

Please sign in to comment.