Compare commits
2 Commits
bae0551895
...
1c6103142f
Author | SHA1 | Date | |
---|---|---|---|
|
1c6103142f | ||
|
328127c55e |
@ -1,5 +1,5 @@
|
|||||||
import { JSX } from "preact";
|
import {JSX} from "preact";
|
||||||
import { createPortal } from "preact/compat";
|
import {createPortal} from "preact/compat";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
setModalOpen: (open: boolean) => never;
|
setModalOpen: (open: boolean) => never;
|
||||||
@ -9,7 +9,7 @@ type Props = {
|
|||||||
children: string | JSX.Element | JSX.Element[] | (() => JSX.Element);
|
children: string | JSX.Element | JSX.Element[] | (() => JSX.Element);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Modal = ({ setModalOpen, title, onSubmit, onSubmitText, children }: Props) => {
|
export const Modal = ({setModalOpen, title, onSubmit, onSubmitText, children}: Props) => {
|
||||||
const body = document.querySelector("body");
|
const body = document.querySelector("body");
|
||||||
|
|
||||||
return createPortal(
|
return createPortal(
|
||||||
@ -34,7 +34,7 @@ export const Modal = ({ setModalOpen, title, onSubmit, onSubmitText, children }:
|
|||||||
<section class="modal-card-body">{children}</section>
|
<section class="modal-card-body">{children}</section>
|
||||||
{onSubmit && (
|
{onSubmit && (
|
||||||
<footer class="modal-card-foot">
|
<footer class="modal-card-foot">
|
||||||
<button class="button is-success" onInput={onSubmit}>
|
<button class="button is-success" onClick={onSubmit}>
|
||||||
{onSubmitText || "Save"}
|
{onSubmitText || "Save"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
|
Loading…
Reference in New Issue
Block a user