Commit 594ad771 by Dominik Prokop Committed by GitHub

Make sidemenu header accept onClick events (#23957)

parent 0742dbc9
......@@ -5,10 +5,11 @@ import { NavModelItem } from '@grafana/data';
interface Props {
link: NavModelItem;
onHeaderClick?: () => void;
}
const SideMenuDropDown: FC<Props> = props => {
const { link } = props;
const { link, onHeaderClick } = props;
let childrenLinks: NavModelItem[] = [];
if (link.children) {
childrenLinks = _.filter(link.children, item => !item.hideFromMenu);
......@@ -17,7 +18,7 @@ const SideMenuDropDown: FC<Props> = props => {
return (
<ul className="dropdown-menu dropdown-menu--sidemenu" role="menu">
<li className="side-menu-header">
<a className="side-menu-header-link" href={link.url}>
<a className="side-menu-header-link" href={link.url} onClick={onHeaderClick}>
<span className="sidemenu-item-text">{link.text}</span>
</a>
</li>
......
......@@ -19,7 +19,7 @@ const TopSectionItem: FC<Props> = props => {
{link.img && <img src={link.img} />}
</span>
</a>
<SideMenuDropDown link={link} />
<SideMenuDropDown link={link} onHeaderClick={onClick} />
</div>
);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment