This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/web/src/elements/sidebar/SidebarBrand.ts

54 lines
1.6 KiB
TypeScript
Raw Normal View History

import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
// @ts-ignore
import PageStyle from "@patternfly/patternfly/components/Page/page.css";
// @ts-ignore
import GlobalsStyle from "@patternfly/patternfly/base/patternfly-globals.css";
import { Config } from "../../api/config";
export const DefaultConfig: Config = {
2020-12-05 21:08:42 +00:00
branding_logo: " /static/dist/assets/icons/icon_left_brand.svg",
branding_title: "authentik",
error_reporting_enabled: false,
error_reporting_environment: "",
error_reporting_send_pii: false,
};
2020-12-05 21:08:42 +00:00
@customElement("ak-sidebar-brand")
export class SidebarBrand extends LitElement {
2020-12-02 14:44:40 +00:00
@property({attribute: false})
config: Config = DefaultConfig;
static get styles(): CSSResult[] {
return [
GlobalsStyle,
PageStyle,
css`
2020-12-05 21:08:42 +00:00
:host {
display: flex;
2020-12-05 21:08:42 +00:00
flex-direction: column;
align-items: center;
height: 82px;
}
.pf-c-brand img {
2020-12-05 21:08:42 +00:00
width: 100%;
padding: 0 .5rem;
2020-12-14 18:26:02 +00:00
height: 42px;
}
`,
];
}
2020-12-05 21:08:42 +00:00
firstUpdated(): void {
Config.get().then((c) => (this.config = c));
}
render(): TemplateResult {
return html` <a href="#/" class="pf-c-page__header-brand-link">
2020-12-05 21:08:42 +00:00
<div class="pf-c-brand ak-brand">
<img src="${this.config.branding_logo}" alt="authentik icon" loading="lazy" />
</div>
</a>`;
}
}