feat: public card modal
This commit is contained in:
@@ -6,9 +6,14 @@ import { useModal } from "~/providers/modal";
|
||||
interface Props {
|
||||
children: React.ReactNode;
|
||||
modalSize?: "sm" | "md" | "lg";
|
||||
positionFromTop?: string;
|
||||
}
|
||||
|
||||
const Modal: React.FC<Props> = ({ children, modalSize = "sm" }) => {
|
||||
const Modal: React.FC<Props> = ({
|
||||
children,
|
||||
modalSize = "sm",
|
||||
positionFromTop = "25vh",
|
||||
}) => {
|
||||
const { isOpen, closeModal } = useModal();
|
||||
|
||||
const modalSizeMap = {
|
||||
@@ -44,7 +49,7 @@ const Modal: React.FC<Props> = ({ children, modalSize = "sm" }) => {
|
||||
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||
>
|
||||
<Dialog.Panel
|
||||
className={`bg-white/1 relative mt-[25vh] w-full transform rounded-lg border border-light-600 text-left shadow-3xl-light backdrop-blur-[10px] transition-all dark:border-dark-600 dark:bg-dark-100/20 dark:shadow-3xl-dark ${modalSizeMap[modalSize]}`}
|
||||
className={`relative mt-[${positionFromTop}] w-full transform rounded-lg border border-light-600 bg-white/90 text-left shadow-3xl-light backdrop-blur-[6px] transition-all dark:border-dark-600 dark:bg-dark-100/90 dark:shadow-3xl-dark ${modalSizeMap[modalSize]}`}
|
||||
>
|
||||
{children}
|
||||
</Dialog.Panel>
|
||||
|
||||
Reference in New Issue
Block a user