[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:
Ivan Ortega Alba
2024-06-21 14:35:27 +03:00
committed by GitHub
parent 7910226cdf
commit b5eeb5fd92
@@ -15,7 +15,7 @@ import { DashboardScene } from './DashboardScene';
import { NavToolbarActions } from './NavToolbarActions';
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 styles = useStyles2(getStyles);
const location = useLocation();
@@ -23,7 +23,6 @@ export function DashboardSceneRenderer({ model }: SceneComponentProps<DashboardS
const pageNav = model.getPageNav(location, navIndex);
const bodyToRender = model.getBodyToRender();
const navModel = getNavModel(navIndex, 'dashboards/browse');
const isHomePage = !meta.url && !meta.slug && !meta.isNew && !meta.isSnapshot;
const hasControls = controls?.hasControls();
if (editview) {
@@ -71,7 +70,7 @@ export function DashboardSceneRenderer({ model }: SceneComponentProps<DashboardS
className={styles.scrollbarContainer}
testId={selectors.pages.Dashboard.DashNav.scrollContainer}
>
<div className={cx(styles.canvasContent, isHomePage && styles.homePagePadding)}>
<div className={cx(styles.canvasContent)}>
<>{isEmpty && emptyState}</>
{withPanels}
</div>
@@ -127,9 +126,6 @@ function getStyles(theme: GrafanaTheme2) {
controlsWrapperWithScopes: css({
padding: theme.spacing(2, 2, 2, 0),
}),
homePagePadding: css({
padding: theme.spacing(2, 2),
}),
canvasContent: css({
label: 'canvas-content',
display: 'flex',