mirror of
https://github.com/FJurmanovic/wallet-web.git
synced 2026-02-06 06:08:10 +00:00
Merge branch 'feature/WW-23-hide-application-in-shadow'
This commit is contained in:
26
src/components/app-shadow/AppShadowElement.ts
Normal file
26
src/components/app-shadow/AppShadowElement.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { attr, targets, controller, target } from "@github/catalyst";
|
||||
import { closest, index, update, isTrue } from "core/utils";
|
||||
import { html, render, until } from "@github/jtml";
|
||||
import { PingService } from "services/";
|
||||
import { AppService, HttpClient, RouterService } from "core/services";
|
||||
import { AuthStore } from "core/store";
|
||||
|
||||
@controller
|
||||
class AppShadowElement extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
@update
|
||||
connectedCallback() {
|
||||
this.attachShadow({ mode: "open" });
|
||||
}
|
||||
|
||||
render() {
|
||||
return html` <app-main></app-main> `;
|
||||
}
|
||||
|
||||
update() {
|
||||
render(this.render(), this.shadowRoot!);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from "./app-shadow/AppShadowElement";
|
||||
export * from "./app-main/AppMainElement";
|
||||
export * from "./app-link/AppLinkElement";
|
||||
export * from "./input-field/InputFieldElement";
|
||||
|
||||
@@ -7,7 +7,7 @@ class RouterService {
|
||||
private domEvents: any = {
|
||||
routechanged: new Event("routechanged"),
|
||||
};
|
||||
constructor(private mainRoot: Element) {}
|
||||
constructor(private mainRoot: ShadowRoot | HTMLElement) {}
|
||||
|
||||
get routerState() {
|
||||
const historyLen = this.historyStack?.length;
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
<title>Wallet Web</title>
|
||||
</head>
|
||||
<body>
|
||||
<app-main></app-main>
|
||||
<app-shadow></app-shadow>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user