From 06a2069619e66feed2294d1734297446ed955a74 Mon Sep 17 00:00:00 2001 From: Ar Rakin <68149013+virtual-designer@users.noreply.github.com> Date: Wed, 28 Aug 2024 05:25:38 +0000 Subject: [PATCH] fix: contact modal does not show up correctly on mobile Signed-off-by: GitHub --- src/components/ContactMail/ContactMail.tsx | 113 ++++++------------ .../ContactMail/ContactMailForm.tsx | 102 ++++++++-------- .../ContactMail/ContactMailFormSchema.ts | 4 + .../ContactMail/EmailSupportLinkWrapper.tsx | 2 +- src/components/ContactMail/useContactMail.ts | 21 ++-- src/redux/slice/ContactMailSlice.ts | 5 +- src/server/contact.ts | 3 +- src/utils/utils.ts | 13 +- 8 files changed, 120 insertions(+), 143 deletions(-) diff --git a/src/components/ContactMail/ContactMail.tsx b/src/components/ContactMail/ContactMail.tsx index 7fe91f5..ad0d5f7 100644 --- a/src/components/ContactMail/ContactMail.tsx +++ b/src/components/ContactMail/ContactMail.tsx @@ -1,11 +1,8 @@ "use client"; -import { Box, Button, Divider } from "@mui/material"; -import clsx from "clsx"; -import { AnimatePresence, motion } from "framer-motion"; +import { Modal, ModalBody, ModalContent, ModalHeader } from "@nextui-org/react"; import { type FC } from "react"; import { HiOutlineEnvelope } from "react-icons/hi2"; -import { MdClose } from "react-icons/md"; import ContactMailForm from "./ContactMailForm"; import { useContactMail } from "./useContactMail"; @@ -22,79 +19,41 @@ const ContactMail: FC = ({ const isOpen = propsIsOpen ?? context.isOpen; return ( - <> - {isOpen && ( - - )} - - {isOpen ? ( - - -

- - - - - - - - Contact Support -

- -
- -
- -
-
- ) : null} -
- + + + {(onClose) => ( + <> + + + + + + + + + + Contact Support + + + + + + + + )} + + ); }; diff --git a/src/components/ContactMail/ContactMailForm.tsx b/src/components/ContactMail/ContactMailForm.tsx index d2e629c..83f0941 100644 --- a/src/components/ContactMail/ContactMailForm.tsx +++ b/src/components/ContactMail/ContactMailForm.tsx @@ -16,10 +16,8 @@ import { ContactMailFormData, ContactMailFormSchema, } from "./ContactMailFormSchema"; -import { useContactMail } from "./useContactMail"; -const ContactMailForm: FC = () => { - const { close } = useContactMail(); +const ContactMailForm: FC<{ onClose: () => void }> = ({ onClose: close }) => { const { control, register, @@ -90,53 +88,61 @@ const ContactMailForm: FC = () => { {isPending && } -
- {" "} - - - -

- We will use this email to contact you back. This will be - kept private. -

- -