mirror of
https://github.com/FJurmanovic/wallet-web.git
synced 2026-11-11 07:41:09 +00:00
formatted files
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
export * from "./menu-layout/MenuLayoutElement";
|
||||
export * from "./initial-layout/InitialLayoutElement";
|
||||
export * from './menu-layout/MenuLayoutElement';
|
||||
export * from './initial-layout/InitialLayoutElement';
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
import { controller, target } from "@github/catalyst";
|
||||
import { closest } from "core/utils";
|
||||
import { html, TemplateResult } from "lit-html";
|
||||
import { BaseLayoutElement } from "common/layouts";
|
||||
import { AppMainElement } from "components/";
|
||||
import { controller, target } from '@github/catalyst';
|
||||
import { closest } from 'core/utils';
|
||||
import { html, TemplateResult } from 'lit-html';
|
||||
import { BaseLayoutElement } from 'common/layouts';
|
||||
import { AppMainElement } from 'components/';
|
||||
|
||||
@controller
|
||||
class InitialLayoutElement extends BaseLayoutElement {
|
||||
@closest appMain: AppMainElement;
|
||||
@target appPage: HTMLDivElement;
|
||||
@closest appMain: AppMainElement;
|
||||
@target appPage: HTMLDivElement;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
elementConnected = (): void => {
|
||||
this.update();
|
||||
};
|
||||
elementConnected = (): void => {
|
||||
this.update();
|
||||
};
|
||||
|
||||
elementDisconnected = (appMain: AppMainElement): void => {};
|
||||
elementDisconnected = (appMain: AppMainElement): void => {};
|
||||
|
||||
render = (): TemplateResult => {
|
||||
return html`
|
||||
<div data-target="initial-layout.appPage">
|
||||
<app-slot data-target="initial-layout.appSlot"></app-slot>
|
||||
</div>
|
||||
`;
|
||||
};
|
||||
render = (): TemplateResult => {
|
||||
return html`
|
||||
<div data-target="initial-layout.appPage">
|
||||
<app-slot data-target="initial-layout.appSlot"></app-slot>
|
||||
</div>
|
||||
`;
|
||||
};
|
||||
}
|
||||
|
||||
export type { InitialLayoutElement };
|
||||
|
||||
@@ -1,50 +1,50 @@
|
||||
import { controller, target } from "@github/catalyst";
|
||||
import { closest } from "core/utils";
|
||||
import { html, TemplateResult } from "lit-html";
|
||||
import { BaseLayoutElement } from "common/layouts";
|
||||
import { AppMainElement } from "components/";
|
||||
import { controller, target } from '@github/catalyst';
|
||||
import { closest } from 'core/utils';
|
||||
import { html, TemplateResult } from 'lit-html';
|
||||
import { BaseLayoutElement } from 'common/layouts';
|
||||
import { AppMainElement } from 'components/';
|
||||
|
||||
@controller
|
||||
class MenuLayoutElement extends BaseLayoutElement {
|
||||
@closest appMain: AppMainElement;
|
||||
@target appPage: HTMLDivElement;
|
||||
@closest appMain: AppMainElement;
|
||||
@target appPage: HTMLDivElement;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
elementConnected = (): void => {
|
||||
this.update();
|
||||
this.appMain.addEventListener("tokenchange", this.updateAuth);
|
||||
this.appMain.addEventListener("routechanged", this.updateAuth);
|
||||
};
|
||||
elementConnected = (): void => {
|
||||
this.update();
|
||||
this.appMain.addEventListener('tokenchange', this.updateAuth);
|
||||
this.appMain.addEventListener('routechanged', this.updateAuth);
|
||||
};
|
||||
|
||||
elementDisconnected = (appMain: AppMainElement): void => {
|
||||
appMain?.removeEventListener("tokenchange", this.updateAuth);
|
||||
appMain?.removeEventListener("routechanged", this.updateAuth);
|
||||
};
|
||||
elementDisconnected = (appMain: AppMainElement): void => {
|
||||
appMain?.removeEventListener('tokenchange', this.updateAuth);
|
||||
appMain?.removeEventListener('routechanged', this.updateAuth);
|
||||
};
|
||||
|
||||
get isAuth(): boolean {
|
||||
const _is = this.appMain?.routerService?.routerState?.middleware;
|
||||
if (typeof _is == "function") {
|
||||
return _is();
|
||||
}
|
||||
return !!_is;
|
||||
}
|
||||
get isAuth(): boolean {
|
||||
const _is = this.appMain?.routerService?.routerState?.middleware;
|
||||
if (typeof _is == 'function') {
|
||||
return _is();
|
||||
}
|
||||
return !!_is;
|
||||
}
|
||||
|
||||
updateAuth = (): void => {
|
||||
this.update();
|
||||
};
|
||||
updateAuth = (): void => {
|
||||
this.update();
|
||||
};
|
||||
|
||||
render = (): TemplateResult => {
|
||||
const _isAuth = this.isAuth;
|
||||
return html`
|
||||
<div data-target="menu-layout.appPage">
|
||||
${_isAuth ? html`<app-menu></app-menu>` : html``}
|
||||
<app-slot data-target="menu-layout.appSlot"></app-slot>
|
||||
</div>
|
||||
`;
|
||||
};
|
||||
render = (): TemplateResult => {
|
||||
const _isAuth = this.isAuth;
|
||||
return html`
|
||||
<div data-target="menu-layout.appPage">
|
||||
${_isAuth ? html`<app-menu></app-menu>` : html``}
|
||||
<app-slot data-target="menu-layout.appSlot"></app-slot>
|
||||
</div>
|
||||
`;
|
||||
};
|
||||
}
|
||||
|
||||
export type { MenuLayoutElement };
|
||||
|
||||
Reference in New Issue
Block a user