tweak layout
CodeQL checks / Analyze (go) (push) Has been cancelled Details
CodeQL checks / Analyze (javascript) (push) Has been cancelled Details
CodeQL checks / Analyze (python) (push) Has been cancelled Details

This commit is contained in:
Ashley Harrison 2025-04-28 09:12:27 +01:00
parent a8ea72012b
commit ed6bf8811e
No known key found for this signature in database
GPG Key ID: FFB870B48A9457E0
3 changed files with 30 additions and 39 deletions

View File

@ -101,21 +101,28 @@ const getStyles = (theme: GrafanaTheme2) => {
position: 'relative', position: 'relative',
}), }),
pageContent: css({ pageContent: css({
backgroundColor: theme.colors.background.primary,
border: `1px solid ${theme.colors.border.weak}`,
borderRadius: theme.shape.radius.default,
label: 'page-content', label: 'page-content',
flexGrow: 1, flexGrow: 1,
padding: theme.spacing(1),
[theme.breakpoints.up('md')]: {
padding: theme.spacing(2),
},
}), }),
primaryBg: css({ primaryBg: css({
background: theme.colors.background.primary, background: theme.colors.background.primary,
}), }),
pageInner: css({ pageInner: css({
label: 'page-inner', label: 'page-inner',
padding: theme.spacing(2),
borderBottom: 'none', borderBottom: 'none',
background: theme.colors.background.primary,
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
flexGrow: 1, flexGrow: 1,
margin: theme.spacing(0, 0, 0, 0), margin: theme.spacing(0, 0, 0, 0),
padding: theme.spacing(2),
[theme.breakpoints.up('md')]: { [theme.breakpoints.up('md')]: {
padding: theme.spacing(4), padding: theme.spacing(4),

View File

@ -1,44 +1,30 @@
import { css } from '@emotion/css'; import { NavModelItem } from '@grafana/data';
import { TabsBar, Tab, toIconName } from '@grafana/ui';
import { NavModelItem, GrafanaTheme2 } from '@grafana/data';
import { useStyles2, TabsBar, Tab, toIconName } from '@grafana/ui';
export interface Props { export interface Props {
navItem: NavModelItem; navItem: NavModelItem;
} }
export function PageTabs({ navItem }: Props) { export function PageTabs({ navItem }: Props) {
const styles = useStyles2(getStyles);
return ( return (
<div className={styles.tabsWrapper}> <TabsBar hideBorder>
<TabsBar> {navItem.children!.map((child, index) => {
{navItem.children!.map((child, index) => { const icon = child.icon ? toIconName(child.icon) : undefined;
const icon = child.icon ? toIconName(child.icon) : undefined; return (
return ( !child.hideFromTabs && (
!child.hideFromTabs && ( <Tab
<Tab label={child.text}
label={child.text} active={child.active}
active={child.active} key={`${child.url}-${index}`}
key={`${child.url}-${index}`} icon={icon}
icon={icon} counter={child.tabCounter}
counter={child.tabCounter} href={child.url}
href={child.url} suffix={child.tabSuffix}
suffix={child.tabSuffix} onChangeTab={child.onClick}
onChangeTab={child.onClick} />
/> )
) );
); })}
})} </TabsBar>
</TabsBar>
</div>
); );
} }
const getStyles = (theme: GrafanaTheme2) => {
return {
tabsWrapper: css({
paddingBottom: theme.spacing(3),
}),
};
};

View File

@ -113,8 +113,6 @@ function getStyles(theme: GrafanaTheme2, variant: LibraryPanelsSearchVariant) {
}), }),
container: css({ container: css({
width: '100%', width: '100%',
overflowY: 'auto',
padding: theme.spacing(1),
}), }),
libraryPanelsView: css({ libraryPanelsView: css({
width: '100%', width: '100%',