Add CopyStateLinkButton to all pages by default.
This commit is contained in:
parent
69b53fb56b
commit
0588f90104
|
@ -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");
|
Loading…
Reference in a new issue