PageHeader: Set h1 style from wrapping element (#67735)

This commit is contained in:
Torkel Ödegaard 2023-05-03 17:19:56 +02:00 committed by GitHub
parent 0271a1d094
commit e3efecacb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ export function PageHeader({ navItem, renderTitle, actions, info, subTitle }: Pr
const styles = useStyles2(getStyles);
const sub = subTitle ?? navItem.subTitle;
const titleElement = renderTitle ? renderTitle(navItem.text) : <h1 className={styles.pageTitle}>{navItem.text}</h1>;
const titleElement = renderTitle ? renderTitle(navItem.text) : <h1>{navItem.text}</h1>;
return (
<div className={styles.pageHeader}>
@ -51,6 +51,10 @@ const getStyles = (theme: GrafanaTheme2) => {
title: css({
display: 'flex',
flexDirection: 'row',
h1: {
display: 'flex',
marginBottom: 0,
},
}),
actions: css({
display: 'flex',
@ -73,10 +77,6 @@ const getStyles = (theme: GrafanaTheme2) => {
gap: theme.spacing(1),
marginBottom: theme.spacing(2),
}),
pageTitle: css({
display: 'flex',
marginBottom: 0,
}),
subTitle: css({
position: 'relative',
color: theme.colors.text.secondary,