web/elements: add PageHeader element to replace page

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-04-10 17:06:54 +02:00
parent 1fbf6be6c2
commit 6f7fb4c919
23 changed files with 456 additions and 561 deletions

View File

@ -1,9 +1,9 @@
import { t } from "@lingui/macro";
import { CSSResult } from "lit-element";
import { html, TemplateResult } from "lit-html";
import { ifDefined } from "lit-html/directives/if-defined";
import { Table } from "./Table";
import "./TableSearch";
import "../../elements/PageHeader";
import PFPage from "@patternfly/patternfly/components/Page/page.css";
import PFContent from "@patternfly/patternfly/components/Content/content.css";
@ -29,16 +29,11 @@ export abstract class TablePage<T> extends Table<T> {
}
render(): TemplateResult {
const description = this.pageDescription();
return html`<section class="pf-c-page__main-section pf-m-light">
<div class="pf-c-content">
<h1>
<i class="${this.pageIcon()}"></i>
${t`${this.pageTitle()}`}
</h1>
${description ? html`<p>${t`${description}`}</p>` : html``}
</div>
</section>
return html`<ak-page-header
icon=${this.pageIcon()}
header=${this.pageTitle()}
description=${ifDefined(this.pageDescription())}>
</ak-page-header>
<section class="pf-c-page__main-section pf-m-no-padding-mobile">
<div class="pf-c-card">${this.renderTable()}</div>
</section>`;