/** @jsx h */ import { ComponentChildren, h, render } from "preact"; import { Modal, ModalInputChannel } from "./components/modal.tsx"; import { Channel } from "@blowater/csp"; import { CenterClass } from "./components/tw.ts"; import { prepareProfileEvent, testEventBus } from "./_setup.test.ts"; import { InMemoryAccountContext } from "@blowater/nostr-sdk"; import { EditProfile } from "./edit-profile.tsx"; const ctx = InMemoryAccountContext.Generate(); const modalChan: ModalInputChannel = new Channel<{ children: ComponentChildren; onClose?: (() => void) | undefined; }>(); const profileEvent = await prepareProfileEvent(ctx, { name: "test_name" }); function ModalTest() { return (
); } render(, document.body); for await (const event of testEventBus.onChange()) { if (event.type === "HideModal") { await modalChan.put({ children: undefined, onClose: event.onClose }); } }