[v11.1.x] Home: Remove extra padding for dashboard home (#89544)
Home: Remove extra padding for dashboard home (#89432)
(cherry picked from commit aea894191b)
This commit is contained in:
@@ -15,7 +15,7 @@ import { DashboardScene } from './DashboardScene';
|
|||||||
import { NavToolbarActions } from './NavToolbarActions';
|
import { NavToolbarActions } from './NavToolbarActions';
|
||||||
|
|
||||||
export function DashboardSceneRenderer({ model }: SceneComponentProps<DashboardScene>) {
|
export function DashboardSceneRenderer({ model }: SceneComponentProps<DashboardScene>) {
|
||||||
const { controls, overlay, editview, editPanel, isEmpty, scopes, meta } = model.useState();
|
const { controls, overlay, editview, editPanel, isEmpty, scopes } = model.useState();
|
||||||
const { isExpanded: isScopesExpanded } = scopes?.useState() ?? {};
|
const { isExpanded: isScopesExpanded } = scopes?.useState() ?? {};
|
||||||
const styles = useStyles2(getStyles);
|
const styles = useStyles2(getStyles);
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
@@ -23,7 +23,6 @@ export function DashboardSceneRenderer({ model }: SceneComponentProps<DashboardS
|
|||||||
const pageNav = model.getPageNav(location, navIndex);
|
const pageNav = model.getPageNav(location, navIndex);
|
||||||
const bodyToRender = model.getBodyToRender();
|
const bodyToRender = model.getBodyToRender();
|
||||||
const navModel = getNavModel(navIndex, 'dashboards/browse');
|
const navModel = getNavModel(navIndex, 'dashboards/browse');
|
||||||
const isHomePage = !meta.url && !meta.slug && !meta.isNew && !meta.isSnapshot;
|
|
||||||
const hasControls = controls?.hasControls();
|
const hasControls = controls?.hasControls();
|
||||||
|
|
||||||
if (editview) {
|
if (editview) {
|
||||||
@@ -71,7 +70,7 @@ export function DashboardSceneRenderer({ model }: SceneComponentProps<DashboardS
|
|||||||
className={styles.scrollbarContainer}
|
className={styles.scrollbarContainer}
|
||||||
testId={selectors.pages.Dashboard.DashNav.scrollContainer}
|
testId={selectors.pages.Dashboard.DashNav.scrollContainer}
|
||||||
>
|
>
|
||||||
<div className={cx(styles.canvasContent, isHomePage && styles.homePagePadding)}>
|
<div className={cx(styles.canvasContent)}>
|
||||||
<>{isEmpty && emptyState}</>
|
<>{isEmpty && emptyState}</>
|
||||||
{withPanels}
|
{withPanels}
|
||||||
</div>
|
</div>
|
||||||
@@ -127,9 +126,6 @@ function getStyles(theme: GrafanaTheme2) {
|
|||||||
controlsWrapperWithScopes: css({
|
controlsWrapperWithScopes: css({
|
||||||
padding: theme.spacing(2, 2, 2, 0),
|
padding: theme.spacing(2, 2, 2, 0),
|
||||||
}),
|
}),
|
||||||
homePagePadding: css({
|
|
||||||
padding: theme.spacing(2, 2),
|
|
||||||
}),
|
|
||||||
canvasContent: css({
|
canvasContent: css({
|
||||||
label: 'canvas-content',
|
label: 'canvas-content',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|||||||
Reference in New Issue
Block a user