1
0
Fork 0

Add CopyStateLinkButton to all pages by default.

This commit is contained in:
ChaotiCryptidz - 2021-11-21 12:00:08 +00:00
parent 69b53fb56b
commit 0588f90104

View file

@ -1,5 +1,7 @@
import { render } from "preact";
import { PageRouter } from "../pagerouter/PageRouter"; import { PageRouter } from "../pagerouter/PageRouter";
import { PageState } from "../state/PageState"; import { PageState } from "../state/PageState";
import { CopyStateLinkButton } from "../ui/elements/CopyStateLinkButton";
export class Page { export class Page {
constructor() { constructor() {
@ -14,7 +16,13 @@ export class Page {
return "Page"; return "Page";
} }
async renderPageTitle(): Promise<void> { async renderPageTitle(): Promise<void> {
this.router.pageTitleElement.innerText = this.name; render(
<>
<span>{this.name}</span>
<CopyStateLinkButton state={this.state} />
</>,
this.router.pageTitleElement,
);
} }
async goBack(): Promise<void> { async goBack(): Promise<void> {
await this.router.changePage("HOME"); await this.router.changePage("HOME");