blowater/UI/components/popover.test.tsx
Bullish Bear cd90528f3e
Popover component (#144)
Co-authored-by: BlowaterNostr <127284497+BlowaterNostr@users.noreply.github.com>
2023-09-08 16:22:15 +00:00

45 lines
1.2 KiB
TypeScript

/** @jsx h */
import { Fragment, h, render } from "https://esm.sh/preact@10.17.1";
import { Popover } from "./popover.tsx";
import { signal } from "https://esm.sh/@preact/signals@1.2.1";
const show = signal(false);
function PopoverTest() {
return (
<Fragment>
<button
onClick={() => {
show.value = true;
}}
>
Show
</button>
{show.value
? (
<Popover
close={() => {
show.value = false;
}}
>
<div
style={{
color: "#fff",
textAlign: "center",
padding: "5rem",
}}
>
Popover
<input type="text" />
</div>
</Popover>
)
: undefined}
</Fragment>
);
}
render(<PopoverTest />, document.body);