web: add default icon for empty state

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-03-16 20:39:07 +01:00
parent 6717f2a68d
commit db99225c65
3 changed files with 7 additions and 9 deletions

View File

@ -1,16 +1,11 @@
import { css, CSSResult } from "lit-element"; import { css, CSSResult } from "lit-element";
// @ts-ignore
import PF from "@patternfly/patternfly/patternfly.css"; import PF from "@patternfly/patternfly/patternfly.css";
// @ts-ignore
import PFAddons from "@patternfly/patternfly/patternfly-addons.css"; import PFAddons from "@patternfly/patternfly/patternfly-addons.css";
// @ts-ignore
import FA from "@fortawesome/fontawesome-free/css/fontawesome.css"; import FA from "@fortawesome/fontawesome-free/css/fontawesome.css";
// @ts-ignore
import AKGlobal from "../authentik.css"; import AKGlobal from "../authentik.css";
// @ts-ignore
import CodeMirrorStyle from "codemirror/lib/codemirror.css"; import CodeMirrorStyle from "codemirror/lib/codemirror.css";
// @ts-ignore
import CodeMirrorTheme from "codemirror/theme/monokai.css"; import CodeMirrorTheme from "codemirror/theme/monokai.css";
export const ColorStyles = css` export const ColorStyles = css`
.pf-m-success { .pf-m-success {
color: var(--pf-global--success-color--100); color: var(--pf-global--success-color--100);

View File

@ -1,5 +1,7 @@
import { CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element"; import { CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import { COMMON_STYLES } from "../common/styles"; import PFEmptyState from "@patternfly/patternfly/components/EmptyState/empty-state.css"
import PFBase from "@patternfly/patternfly/patternfly-base.css"
import FA from "@fortawesome/fontawesome-free/css/fontawesome.css";
@customElement("ak-empty-state") @customElement("ak-empty-state")
export class EmptyState extends LitElement { export class EmptyState extends LitElement {
@ -11,13 +13,13 @@ export class EmptyState extends LitElement {
header?: string; header?: string;
static get styles(): CSSResult[] { static get styles(): CSSResult[] {
return COMMON_STYLES; return [PFEmptyState, PFBase, FA];
} }
render(): TemplateResult { render(): TemplateResult {
return html`<div class="pf-c-empty-state"> return html`<div class="pf-c-empty-state">
<div class="pf-c-empty-state__content"> <div class="pf-c-empty-state__content">
<i class="pf-icon ${this.icon} pf-c-empty-state__icon" aria-hidden="true"></i> <i class="pf-icon fa ${this.icon || "fa-question-circle"} pf-c-empty-state__icon" aria-hidden="true"></i>
<h1 class="pf-c-title pf-m-lg"> <h1 class="pf-c-title pf-m-lg">
${this.header} ${this.header}
</h1> </h1>

1
web/src/global.d.ts vendored Normal file
View File

@ -0,0 +1 @@
declare module "*.css";