Files
formbricks/apps/web/components/preview/Modal.tsx
T
Johannes 41443267c9 Revamp survey settings (#287)
* improve survey settings flow

---------

Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
2023-05-19 08:33:52 +02:00

23 lines
751 B
TypeScript

import { cn } from "@formbricks/lib/cn";
import { ReactNode, useEffect, useState } from "react";
export default function Modal({ children, isOpen }: { children: ReactNode; isOpen: boolean }) {
const [show, setShow] = useState(false);
useEffect(() => {
setShow(isOpen);
}, [isOpen]);
return (
<div aria-live="assertive" className="flex w-full grow items-end justify-end p-4">
<div
className={cn(
show ? "translate-x-0 opacity-100" : "translate-x-32 opacity-0",
"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white px-4 py-6 shadow-lg ring-1 ring-black ring-opacity-5 transition-all duration-500 ease-in-out sm:p-6"
)}>
{children}
</div>
</div>
);
}