diff options
author | Nick Tchayka <nick@booster.cloud> | 2023-09-06 15:19:23 +0100 |
---|---|---|
committer | Nick Tchayka <nick@booster.cloud> | 2023-09-06 15:19:23 +0100 |
commit | 98c87787db3d16548b616fa890bab131263d4a47 (patch) | |
tree | 30bfa40c0c5b4b565492487204b05ef68bb083d4 /src/components/Dialog.tsx | |
parent | b8887b6f0befcd4c695b08b80a92cb8616d9df7c (diff) | |
download | neohaskell.github.io-98c87787db3d16548b616fa890bab131263d4a47.tar.gz neohaskell.github.io-98c87787db3d16548b616fa890bab131263d4a47.tar.bz2 neohaskell.github.io-98c87787db3d16548b616fa890bab131263d4a47.zip |
Add modal
Diffstat (limited to 'src/components/Dialog.tsx')
-rw-r--r-- | src/components/Dialog.tsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/components/Dialog.tsx b/src/components/Dialog.tsx index 0258e88..b10ed5f 100644 --- a/src/components/Dialog.tsx +++ b/src/components/Dialog.tsx @@ -3,7 +3,7 @@ import Button from "./Button"; import classNames from "classnames"; type DialogType = { - message: string; + children?: React.ReactNode; width?: "fit" | "full" | "1/2" | "1/3"; cancelButtonText?: string; actionButtonText?: string; @@ -18,7 +18,7 @@ type DialogType = { }; const Dialog = ({ - message, + children, width, cancelButtonText, actionButtonText, @@ -27,25 +27,26 @@ const Dialog = ({ return ( <div className={classNames( - "px-8 py-4 dark:bg-slate-850 bg-white border-4 border-black shadow-[8px_8px_0px_rgba(0,0,0,1)] grid place-content-center", + "p-9 dark:bg-slate-850 bg-white border-4 border-black shadow-[8px_8px_0px_rgba(0,0,0,1)] grid place-content-center", { "w-fit": width === "fit" }, { "w-full": width === "full" }, { "w-1/2": width === "1/2" }, { "w-1/3": width === "1/3" } )} > - <div> - <h1 className="text-2xl mb-4">{message}</h1> + <div className="flex flex-col gap-4"> + {children} <div className="flex space-x-2 mx-auto"> {cancelButtonText && ( <button className="text-base">{cancelButtonText}</button> )} {actionButtonText && ( <Button - buttonText={actionButtonText} rounded="full" color={actionButtonColor && actionButtonColor} - /> + > + <h3>{actionButtonText}</h3> + </Button> )} </div> </div> |