feat: new dialog for sharing avatar

This commit is contained in:
San
2023-10-17 18:42:39 +08:00
parent 12bb56216b
commit 9b5007ab58
+32
View File
@@ -0,0 +1,32 @@
import { ComfyDialog, $el } from '../../scripts/ui.js';
export class InfoDialog extends ComfyDialog {
constructor() {
super();
this.element.classList.add("comfy-normal-modal");
}
createButtons() {
return [
$el("button", {
type: "button",
textContent: "Close",
onclick: () => this.close(),
}),
];
}
close() {
this.element.style.display = "none";
}
show(html) {
if (typeof html === "string") {
this.textElement.innerHTML = html;
} else {
this.textElement.replaceChildren(html);
}
this.element.style.display = "flex";
}
}
export const infoDialog = new InfoDialog()