diff --git a/public/app/core/components/AppChrome/MegaMenu/MegaMenuItem.tsx b/public/app/core/components/AppChrome/MegaMenu/MegaMenuItem.tsx index 528c0c9a04f..48504e5319f 100644 --- a/public/app/core/components/AppChrome/MegaMenu/MegaMenuItem.tsx +++ b/public/app/core/components/AppChrome/MegaMenu/MegaMenuItem.tsx @@ -4,7 +4,7 @@ import { useLocation } from 'react-router-dom'; import { useLocalStorage } from 'react-use'; import { GrafanaTheme2, NavModelItem, toIconName } from '@grafana/data'; -import { useStyles2, Text, IconButton, Icon } from '@grafana/ui'; +import { useStyles2, Text, IconButton, Icon, Stack } from '@grafana/ui'; import { useGrafana } from 'app/core/context/GrafanaContext'; import { Indent } from '../../Indent/Indent'; @@ -59,11 +59,23 @@ export function MegaMenuItem({ link, activeItem, level = 0, onClick }: Props) { return null; } + let iconElement: React.JSX.Element | null = null; + + if (link.icon) { + iconElement = ; + } else if (link.img) { + iconElement = ( + + + + ); + } + return (
  • {level !== 0 && } @@ -93,14 +105,10 @@ export function MegaMenuItem({ link, activeItem, level = 0, onClick }: Props) {
    - {level === 0 && link.icon && ( - - - - )} + {level === 0 && iconElement && {iconElement}} {link.text}
    @@ -135,6 +143,10 @@ const getStyles = (theme: GrafanaTheme2) => ({ icon: css({ width: theme.spacing(3), }), + img: css({ + height: theme.spacing(2), + width: theme.spacing(2), + }), listItem: css({ flex: 1, maxWidth: '100%',