Add support for S3-backed image storage
This commit is contained in:
1 parent
46186a8abc
commit
d206da181b
25 files changed
+2678
-93
No files matched your search
@@ -2,14 +2,22 @@ import { JSX } from "preact";
|
||||
import { createPortal } from "preact/compat";
|
||||
|
||||
type Props = {
|
||||
setModalOpen: (open: boolean) => never;
|
||||
setModalOpen: (open: boolean) => void;
|
||||
title: string | JSX.Element;
|
||||
onSubmitText?: string;
|
||||
onSubmit?: () => void;
|
||||
onSubmitDisabled?: boolean;
|
||||
children: string | JSX.Element | JSX.Element[] | (() => JSX.Element);
|
||||
};
|
||||
|
||||
export const Modal = ({ setModalOpen, title, onSubmit, onSubmitText, children }: Props) => {
|
||||
export const Modal = ({
|
||||
setModalOpen,
|
||||
title,
|
||||
onSubmit,
|
||||
onSubmitText,
|
||||
onSubmitDisabled,
|
||||
children,
|
||||
}: Props) => {
|
||||
const body = document.querySelector("body");
|
||||
|
||||
return createPortal(
|
||||
@@ -34,7 +42,11 @@ 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" onClick={onSubmit}>
|
||||
<button
|
||||
class="button is-success"
|
||||
onClick={onSubmit}
|
||||
disabled={onSubmitDisabled}
|
||||
>
|
||||
{onSubmitText || "Save"}
|
||||
</button>
|
||||
<button
|
||||
|
||||
Reference in new issue
Block a user