diff --git a/src/components/modals/safe.tsx b/src/components/modals/safe.tsx index a382c0ef9..06d85e113 100644 --- a/src/components/modals/safe.tsx +++ b/src/components/modals/safe.tsx @@ -12,6 +12,7 @@ type SafeModalProps = { export const SafeModal: React.FC = ({ type }) => { const [open, setOpen] = useState(true); + const handleClose = () => setOpen(false); return ( = ({ type }) => { }, }} > - + ); }; diff --git a/src/components/safe/form/index.tsx b/src/components/safe/form/index.tsx index 16f6b32ca..c56d2d7bd 100644 --- a/src/components/safe/form/index.tsx +++ b/src/components/safe/form/index.tsx @@ -33,6 +33,7 @@ import { useSession } from "next-auth/react"; type SafeFormProps = { type: "create" | "import"; + handleClose: () => void; }; const SafeFormSchema = z.object({ @@ -53,7 +54,7 @@ type SafeFormType = z.infer; const placeholder = "________________________________________"; -export const SafeForm: React.FC = ({ type }) => { +export const SafeForm: React.FC = ({ type, handleClose }) => { const { data: session } = useSession(); const { mutate } = useMutation(createSafe); @@ -75,6 +76,8 @@ export const SafeForm: React.FC = ({ type }) => { json: { ...data }, urlParams: { companyId: session?.user.companyId ?? "" }, }); + + handleClose(); }; return (