From 54cbdc0ffebdc93da2db09369d3fc252ad8e3d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=9A=B0?= Date: Sun, 12 Nov 2023 20:52:29 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20report=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/room/[id].tsx | 56 +++++++++++---------------------------------- 1 file changed, 13 insertions(+), 43 deletions(-) diff --git a/pages/room/[id].tsx b/pages/room/[id].tsx index 75aff7c..69574d7 100644 --- a/pages/room/[id].tsx +++ b/pages/room/[id].tsx @@ -193,8 +193,20 @@ export default function RoomDetail() { setIsShowDetail((value) => !value); }; + const { openModal, closeModal } = useModal(); + const showReporting = () => { - setShowReport(true); + openModal({ + props: { + title: 'Why are you reporting?', + content: "This wan't be shared with the reported user", + buttonName: 'Report', + buttonNames: ['Not a real place', 'Inappropriate content', 'Incorrect information', 'Suspected scammer'], + handleClose: () => { + closeModal(); + }, + }, + }); }; const handleReport = () => { @@ -210,8 +222,6 @@ export default function RoomDetail() { ); }, [room?.maintenance]); - const { openModal, closeModal } = useModal(); - const handleButtonClick = () => { window.history.back(); }; @@ -438,49 +448,9 @@ export default function RoomDetail() { buttonType="wrapper" buttonName="Report" buttonNames={['Not a real place', 'Inappropriate content', 'Incorrect information', 'Suspected scammer']} - handleClose={() => setShowReport(false)} handleCustomEvent={handleReport} /> )} - {/* {showContact && ( - setShowContact(false)} - handleCustomEvent={handleContact} - buttonName="Contact" - disabledBtn={contactDisabled} - > -
-

Do you like this room?

-

-

Contact info

- { - const isValid = isRequired(value, '필수 항목') || isValidEmail(value, `isValidEmail`); - return isValid; - }, - })} - error={errors.email as FieldError} - /> -

Message

-