render clean up

This commit is contained in:
Niels Lyngsø
2024-04-18 14:32:56 +02:00
parent 86635eb597
commit f341206bfc
3 changed files with 9 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
import type { UmbBackofficeContext } from '../backoffice.context.js';
import { UMB_BACKOFFICE_CONTEXT } from '../backoffice.context.js';
import { css, html, customElement, state } from '@umbraco-cms/backoffice/external/lit';
import { css, html, customElement, state, nothing } from '@umbraco-cms/backoffice/external/lit';
import { UmbSectionContext, UMB_SECTION_CONTEXT } from '@umbraco-cms/backoffice/section';
import type { UmbRoute, UmbRouterSlotChangeEvent } from '@umbraco-cms/backoffice/router';
import type { ManifestSection, UmbSectionElement } from '@umbraco-cms/backoffice/extension-registry';
@@ -99,17 +99,18 @@ export class UmbBackofficeMainElement extends UmbLitElement {
render() {
return this._routes.length > 0
? html`<umb-router-slot .routes=${this._routes} @change=${this._onRouteChange}></umb-router-slot>`
: '';
: nothing;
}
static styles = [
css`
:host {
background-color: var(--uui-color-background);
display: block;
background-color: var(--uui-color-background);
width: 100%;
height: calc(
100% - 60px
); // 60 => top header height, TODO: Make sure this comes from somewhere so it is maintainable and eventually responsive.
); /* 60 => top header height, TODO: Make sure this comes from somewhere so it is maintainable and eventually responsive. */
}
`,
];

View File

@@ -86,7 +86,7 @@ export class UmbSectionDefaultElement extends UmbLitElement implements UmbSectio
(app) => app.component,
)}
</umb-section-sidebar>
`
`
: nothing}
<umb-section-main>
${this._routes && this._routes.length > 0
@@ -105,10 +105,6 @@ export class UmbSectionDefaultElement extends UmbLitElement implements UmbSectio
height: 100%;
display: flex;
}
h3 {
padding: var(--uui-size-4) var(--uui-size-8);
}
`,
];
}

View File

@@ -98,7 +98,7 @@ export class UmbSectionMainViewElement extends UmbLitElement {
</umb-router-slot>
</umb-body-layout>
`
: html`${nothing}`;
: nothing;
}
#renderDashboards() {
@@ -117,7 +117,7 @@ export class UmbSectionMainViewElement extends UmbLitElement {
})}
</uui-tab-group>
`
: '';
: nothing;
}
#renderViews() {
@@ -140,7 +140,7 @@ export class UmbSectionMainViewElement extends UmbLitElement {
})}
</uui-tab-group>
`
: '';
: nothing;
}
static styles = [