Fix images not setting properly

This commit is contained in:
jude
2024-02-28 16:58:44 +00:00
parent b0e37b56c0
commit 328127c55e
4 changed files with 18 additions and 7 deletions

View File

@ -1,5 +1,5 @@
import { JSX } from "preact";
import { createPortal } from "preact/compat";
import {JSX} from "preact";
import {createPortal} from "preact/compat";
type Props = {
setModalOpen: (open: boolean) => never;
@ -9,7 +9,7 @@ type Props = {
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");
return createPortal(
@ -34,7 +34,7 @@ export const Modal = ({ setModalOpen, title, onSubmit, onSubmitText, children }:
<section class="modal-card-body">{children}</section>
{onSubmit && (
<footer class="modal-card-foot">
<button class="button is-success" onInput={onSubmit}>
<button class="button is-success" onClick={onSubmit}>
{onSubmitText || "Save"}
</button>
<button