mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Navigation: Minor tweak to dockedMegaMenu to make it slightly tighter (#77493)
minor tweak to dockedMegaMenu to make it slightly tighter
This commit is contained in:
@@ -63,7 +63,7 @@ export function MegaMenuItem({ link, activeItem, level = 0, onClick }: Props) {
|
|||||||
<li ref={item} className={styles.listItem}>
|
<li ref={item} className={styles.listItem}>
|
||||||
<div
|
<div
|
||||||
className={cx(styles.menuItem, {
|
className={cx(styles.menuItem, {
|
||||||
[styles.hasIcon]: Boolean(level === 0 && link.icon),
|
[styles.menuItemWithIcon]: Boolean(level === 0 && link.icon),
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{level !== 0 && <Indent level={level === MAX_DEPTH ? level - 1 : level} spacing={3} />}
|
{level !== 0 && <Indent level={level === MAX_DEPTH ? level - 1 : level} spacing={3} />}
|
||||||
@@ -93,6 +93,7 @@ export function MegaMenuItem({ link, activeItem, level = 0, onClick }: Props) {
|
|||||||
<div
|
<div
|
||||||
className={cx(styles.labelWrapper, {
|
className={cx(styles.labelWrapper, {
|
||||||
[styles.hasActiveChild]: hasActiveChild,
|
[styles.hasActiveChild]: hasActiveChild,
|
||||||
|
[styles.labelWrapperWithIcon]: Boolean(level === 0 && link.icon),
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{level === 0 && link.icon && (
|
{level === 0 && link.icon && (
|
||||||
@@ -141,9 +142,12 @@ const getStyles = (theme: GrafanaTheme2) => ({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
gap: theme.spacing(1),
|
gap: theme.spacing(1),
|
||||||
height: theme.spacing(4),
|
height: theme.spacing(4),
|
||||||
paddingLeft: theme.spacing(1),
|
paddingLeft: theme.spacing(0.5),
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
}),
|
}),
|
||||||
|
menuItemWithIcon: css({
|
||||||
|
paddingLeft: theme.spacing(0),
|
||||||
|
}),
|
||||||
collapseButtonWrapper: css({
|
collapseButtonWrapper: css({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
@@ -178,9 +182,10 @@ const getStyles = (theme: GrafanaTheme2) => ({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
gap: theme.spacing(2),
|
gap: theme.spacing(2),
|
||||||
minWidth: 0,
|
minWidth: 0,
|
||||||
|
paddingLeft: theme.spacing(1),
|
||||||
}),
|
}),
|
||||||
hasIcon: css({
|
labelWrapperWithIcon: css({
|
||||||
paddingLeft: theme.spacing(0),
|
paddingLeft: theme.spacing(0.5),
|
||||||
}),
|
}),
|
||||||
hasActiveChild: css({
|
hasActiveChild: css({
|
||||||
color: theme.colors.text.primary,
|
color: theme.colors.text.primary,
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ const getStyles = (theme: GrafanaTheme2, isActive: Props['isActive']) => ({
|
|||||||
display: 'flex',
|
display: 'flex',
|
||||||
gap: '0.5rem',
|
gap: '0.5rem',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
paddingLeft: theme.spacing(1),
|
|
||||||
width: '100%',
|
width: '100%',
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user