mirror of
https://github.com/FJurmanovic/wallet-web.git
synced 2026-11-11 15:51:10 +00:00
formatted files
This commit is contained in:
@@ -1,45 +1,43 @@
|
||||
import { attr } from "@github/catalyst";
|
||||
import { html, render } from "lit-html";
|
||||
import { BaseElement } from "common/";
|
||||
import { isTrue } from "core/utils";
|
||||
import { attr } from '@github/catalyst';
|
||||
import { html, render } from 'lit-html';
|
||||
import { BaseElement } from 'common/';
|
||||
import { isTrue } from 'core/utils';
|
||||
|
||||
class BasePageElement extends BaseElement {
|
||||
public pageTitle: string = "";
|
||||
@attr hidetitle: string;
|
||||
@attr customtitle: string;
|
||||
constructor(options: OptionType) {
|
||||
super();
|
||||
if (options?.title) {
|
||||
this.pageTitle = options?.title;
|
||||
}
|
||||
this.connectedCallback = this.connectedCallback.bind(this);
|
||||
this.disconnectedCallback = this.disconnectedCallback.bind(this);
|
||||
}
|
||||
public pageTitle: string = '';
|
||||
@attr hidetitle: string;
|
||||
@attr customtitle: string;
|
||||
constructor(options: OptionType) {
|
||||
super();
|
||||
if (options?.title) {
|
||||
this.pageTitle = options?.title;
|
||||
}
|
||||
this.connectedCallback = this.connectedCallback.bind(this);
|
||||
this.disconnectedCallback = this.disconnectedCallback.bind(this);
|
||||
}
|
||||
|
||||
public renderTitle = () => {
|
||||
if (!isTrue(this.hidetitle)) {
|
||||
return html`<div class="page --title">
|
||||
${this.customtitle ? this.customtitle : this.pageTitle}
|
||||
</div>`;
|
||||
}
|
||||
return html``;
|
||||
};
|
||||
public renderTitle = () => {
|
||||
if (!isTrue(this.hidetitle)) {
|
||||
return html`<div class="page --title">${this.customtitle ? this.customtitle : this.pageTitle}</div>`;
|
||||
}
|
||||
return html``;
|
||||
};
|
||||
|
||||
update = (): void => {
|
||||
const _render = () => html` ${this.renderTitle()} ${this.render()} `;
|
||||
render(_render(), this);
|
||||
this.bindEvents("app-action");
|
||||
this.updateCallback();
|
||||
};
|
||||
update = (): void => {
|
||||
const _render = () => html` ${this.renderTitle()} ${this.render()} `;
|
||||
render(_render(), this);
|
||||
this.bindEvents('app-action');
|
||||
this.updateCallback();
|
||||
};
|
||||
|
||||
connectedCallback() {
|
||||
this.appMain.setTitle(this.pageTitle);
|
||||
super.connectedCallback();
|
||||
}
|
||||
connectedCallback() {
|
||||
this.appMain.setTitle(this.pageTitle);
|
||||
super.connectedCallback();
|
||||
}
|
||||
}
|
||||
|
||||
export default BasePageElement;
|
||||
|
||||
export type OptionType = {
|
||||
title?: string;
|
||||
title?: string;
|
||||
};
|
||||
|
||||
@@ -1 +1 @@
|
||||
export { default as BasePageElement } from "./BasePageElement/BasePageElement";
|
||||
export { default as BasePageElement } from './BasePageElement/BasePageElement';
|
||||
|
||||
Reference in New Issue
Block a user