mirror of
https://github.com/BlowaterNostr/blowater.git
synced 2024-10-18 23:43:23 +00:00
cd90528f3e
Co-authored-by: BlowaterNostr <127284497+BlowaterNostr@users.noreply.github.com>
45 lines
1.2 KiB
TypeScript
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);
|