From 2bbccd890469484c23078e06d1f73a6aaa1007a9 Mon Sep 17 00:00:00 2001 From: jinhyeonkwon Date: Tue, 24 Sep 2024 22:27:08 +0900 Subject: [PATCH 1/2] feat: delete mission-complete-related codes --- .../ModalPopup/ModalChatPayment.tsx | 7 -- .../ModalPopup/ModalChatSaveAccount.tsx | 7 -- .../ModalPopup/ModalChatSettlement.tsx | 5 -- .../ModalEvent2024FallDailyAttendance.tsx | 4 - .../ModalPopup/ModalEvent2024FallJoin.tsx | 9 +-- .../ModalPopup/ModalMypageModify.tsx | 10 --- .../ModalPopup/ModalNotification.tsx | 13 ---- .../components/ModalPopup/ModalRoomShare.tsx | 17 +--- packages/web/src/pages/Addroom/index.tsx | 78 ------------------- 9 files changed, 2 insertions(+), 148 deletions(-) diff --git a/packages/web/src/components/ModalPopup/ModalChatPayment.tsx b/packages/web/src/components/ModalPopup/ModalChatPayment.tsx index d19b55b1..cfcafc6f 100644 --- a/packages/web/src/components/ModalPopup/ModalChatPayment.tsx +++ b/packages/web/src/components/ModalPopup/ModalChatPayment.tsx @@ -1,7 +1,6 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import useAccountFromChats from "@/hooks/chat/useAccountFromChats"; -import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete"; import { useValueRecoilState } from "@/hooks/useFetchRecoilState"; import { useAxios } from "@/hooks/useTaxiAPI"; @@ -50,9 +49,6 @@ const ModalChatPayment = ({ [userOid, roomInfo] ); const onCopy = useCallback(() => setIsCopied(true), [setIsCopied]); - //#region event2024Fall - const event2024FallQuestComplete = useEvent2024FallQuestComplete(); - //#endregion useEffect(() => { if (isCopied) { @@ -69,9 +65,6 @@ const ModalChatPayment = ({ method: "post", data: { roomId: roomInfo._id }, onSuccess: () => { - //#region event2024Fall - event2024FallQuestComplete("farePayment"); - //#endregion modalProps.onChangeIsOpen?.(false); onRecall?.(); }, diff --git a/packages/web/src/components/ModalPopup/ModalChatSaveAccount.tsx b/packages/web/src/components/ModalPopup/ModalChatSaveAccount.tsx index e5ce6b20..5aec2dc6 100644 --- a/packages/web/src/components/ModalPopup/ModalChatSaveAccount.tsx +++ b/packages/web/src/components/ModalPopup/ModalChatSaveAccount.tsx @@ -1,6 +1,5 @@ import { useCallback, useEffect, useState } from "react"; -import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete"; import { useFetchRecoilState, useValueRecoilState, @@ -32,9 +31,6 @@ const ModalChatSaveAcount = ({ const { account: accountOrigin } = useValueRecoilState("loginInfo") || {}; const [account, setAccount] = useState(accountDefault || ""); const fetchLoginInfo = useFetchRecoilState("loginInfo"); - //#region event2024Fall - const event2024FallQuestComplete = useEvent2024FallQuestComplete(); - //#endregion useEffect(() => setAccount(accountDefault || ""), [accountDefault]); @@ -45,9 +41,6 @@ const ModalChatSaveAcount = ({ method: "post", data: { account }, onSuccess: () => { - //#region event2024Fall - event2024FallQuestComplete("accountChanging"); - //#endregion fetchLoginInfo(); }, onError: () => setAlert("계좌번호 저장을 실패하였습니다."), diff --git a/packages/web/src/components/ModalPopup/ModalChatSettlement.tsx b/packages/web/src/components/ModalPopup/ModalChatSettlement.tsx index d9179994..d0ef39d3 100644 --- a/packages/web/src/components/ModalPopup/ModalChatSettlement.tsx +++ b/packages/web/src/components/ModalPopup/ModalChatSettlement.tsx @@ -1,7 +1,6 @@ import { useMemo, useRef, useState } from "react"; import useSendMessage from "@/hooks/chat/useSendMessage"; -import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete"; import { useValueRecoilState } from "@/hooks/useFetchRecoilState"; import { useAxios } from "@/hooks/useTaxiAPI"; @@ -40,7 +39,6 @@ const ModalChatSettlement = ({ const isValidAccount = useMemo(() => regExpTest.account(account), [account]); const isRequesting = useRef(false); const sendMessage = useSendMessage(roomInfo._id, isRequesting); - const event2024FallQuestComplete = useEvent2024FallQuestComplete(); const onClickOk = () => { if (isRequesting.current || !isValidAccount) return; @@ -57,9 +55,6 @@ const ModalChatSettlement = ({ isRequesting.current = false; if (account !== defaultAccount) openSaveAccountModal?.(account); } - //#region event2024Fall - event2024FallQuestComplete("fareSettlement"); - //#endregion modalProps.onChangeIsOpen?.(false); }, onError: () => { diff --git a/packages/web/src/components/ModalPopup/ModalEvent2024FallDailyAttendance.tsx b/packages/web/src/components/ModalPopup/ModalEvent2024FallDailyAttendance.tsx index c2623250..8dbe2475 100644 --- a/packages/web/src/components/ModalPopup/ModalEvent2024FallDailyAttendance.tsx +++ b/packages/web/src/components/ModalPopup/ModalEvent2024FallDailyAttendance.tsx @@ -1,6 +1,5 @@ import { useEffect, useState } from "react"; -import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete"; import { useValueRecoilState } from "@/hooks/useFetchRecoilState"; import Button from "@/components/Button"; @@ -47,8 +46,6 @@ const ModalEvent2024FallDailyAttendance = ({ today.date(), ]); - const event2024FallQuestComplete = useEvent2024FallQuestComplete(); - const { isAgreeOnTermsOfEvent = false, completedQuests = [] } = useValueRecoilState("event2024FallInfo") || {}; @@ -63,7 +60,6 @@ const ModalEvent2024FallDailyAttendance = ({ if (onChangeIsOpen && modalOpened) { onChangeIsOpen(modalOpened); // 모달 열기 상태 변경 - event2024FallQuestComplete("dailyAttendance"); } }, [isAgreeOnTermsOfEvent, todayInitial.length]); diff --git a/packages/web/src/components/ModalPopup/ModalEvent2024FallJoin.tsx b/packages/web/src/components/ModalPopup/ModalEvent2024FallJoin.tsx index 0ab06ce0..5d20f79b 100644 --- a/packages/web/src/components/ModalPopup/ModalEvent2024FallJoin.tsx +++ b/packages/web/src/components/ModalPopup/ModalEvent2024FallJoin.tsx @@ -1,6 +1,5 @@ import { useCallback, useEffect, useMemo, useState } from "react"; -import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete"; import { useFetchRecoilState, useIsLogin, @@ -41,9 +40,6 @@ const ModalEvent2024FallJoin = ({ const { isAgreeOnTermsOfEvent } = useValueRecoilState("event2024FallInfo") || {}; const fetchLoginInfo = useFetchRecoilState("loginInfo"); - //#region event2024fall - const event2024FallQuestComplete = useEvent2024FallQuestComplete(); - //#endregion const [phoneNumber, setPhoneNumber] = useState( phoneNumberFromLoginInfo || "" @@ -83,14 +79,11 @@ const ModalEvent2024FallJoin = ({ data: { phoneNumber, inviter: inviterId }, onSuccess: () => { fetchLoginInfo(); - //#region event2024fall - event2024FallQuestComplete("firstLogin"); - //#endregion modalProps.onChangeIsOpen?.(false); }, onError: () => setAlert("이벤트 참여에 실패하였습니다."), }), - [phoneNumber, setPhoneNumber, event2024FallQuestComplete] + [phoneNumber, setPhoneNumber] ); const styleTitle = { diff --git a/packages/web/src/components/ModalPopup/ModalMypageModify.tsx b/packages/web/src/components/ModalPopup/ModalMypageModify.tsx index b85ed44d..f51fa554 100644 --- a/packages/web/src/components/ModalPopup/ModalMypageModify.tsx +++ b/packages/web/src/components/ModalPopup/ModalMypageModify.tsx @@ -2,7 +2,6 @@ import axiosOri from "axios"; import { useCallback, useEffect, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; -import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete"; import { useFetchRecoilState, useValueRecoilState, @@ -144,9 +143,6 @@ const ModalMypageModify = ({ ...modalProps }: ModalMypageModifyProps) => { const loginInfo = useValueRecoilState("loginInfo"); const fetchLoginInfo = useFetchRecoilState("loginInfo"); - //#region event2024Fall - const event2024FallQuestComplete = useEvent2024FallQuestComplete(); - //#endregion const setAlert = useSetRecoilState(alertAtom); useEffect(() => { @@ -169,9 +165,6 @@ const ModalMypageModify = ({ ...modalProps }: ModalMypageModifyProps) => { method: "post", data: { nickname }, onError: () => setAlert(t("page_modify.nickname_failed")), - //#region event2024Fall - onSuccess: () => event2024FallQuestComplete("nicknameChanging"), // event2024Fall - //#endregion }); } if (account !== loginInfo?.account) { @@ -181,9 +174,6 @@ const ModalMypageModify = ({ ...modalProps }: ModalMypageModifyProps) => { method: "post", data: { account }, onError: () => setAlert(t("page_modify.account_failed")), - //#region event2024Fall - onSuccess: () => event2024FallQuestComplete("accountChanging"), // event2024Fall - //#endregion }); } if (isNeedToUpdateLoginInfo) { diff --git a/packages/web/src/components/ModalPopup/ModalNotification.tsx b/packages/web/src/components/ModalPopup/ModalNotification.tsx index fbd19675..9ed2ce85 100644 --- a/packages/web/src/components/ModalPopup/ModalNotification.tsx +++ b/packages/web/src/components/ModalPopup/ModalNotification.tsx @@ -1,7 +1,6 @@ import { useCallback, useRef } from "react"; import { useTranslation } from "react-i18next"; -import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete"; import { useFetchRecoilState, useValueRecoilState, @@ -65,9 +64,6 @@ const ModalNotification = ({ const notificationOptions = useValueRecoilState("notificationOptions"); const fetchNotificationOptions = useFetchRecoilState("notificationOptions"); const isAxiosCalled = useRef(false); - //#region event2024Fall - const event2024FallQuestComplete = useEvent2024FallQuestComplete(); - //#endregion const styleTitle = { ...theme.font18, @@ -112,11 +108,6 @@ const ModalNotification = ({ }); fetchNotificationOptions(); isAxiosCalled.current = false; - - //#region event2024Fall - if (optionName === "advertisement" && value) - event2024FallQuestComplete("adPushAgreement"); - //#endregion }, [deviceToken] ); @@ -148,10 +139,6 @@ const ModalNotification = ({ }); fetchNotificationOptions(); isAxiosCalled.current = false; - - //#region event2024Fall - if (value) event2024FallQuestComplete("adPushAgreement"); - //#endregion }, [deviceToken] ); diff --git a/packages/web/src/components/ModalPopup/ModalRoomShare.tsx b/packages/web/src/components/ModalPopup/ModalRoomShare.tsx index 087d04be..0b317aec 100644 --- a/packages/web/src/components/ModalPopup/ModalRoomShare.tsx +++ b/packages/web/src/components/ModalPopup/ModalRoomShare.tsx @@ -1,5 +1,3 @@ -import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete"; - import Modal from "@/components/Modal"; import BodyRoomShare, { BodyRoomShareProps } from "./Body/BodyRoomShare"; @@ -19,9 +17,6 @@ const ModalRoomShare = ({ onChangeIsOpen, roomInfo, }: ModalRoomShareProps) => { - //#region event2024Fall - const event2024FallQuestComplete = useEvent2024FallQuestComplete(); - //#endregion const styleTitle = { ...theme.font18, display: "flex", @@ -32,19 +27,9 @@ const ModalRoomShare = ({ fontSize: "21px", margin: "0 4px 0 0", }; - //#region event2024Fall - const onChangeIsOpenWithEvent2024Fall = (isOpen: boolean) => { - onChangeIsOpen?.(isOpen); - !isOpen && event2024FallQuestComplete("roomSharing"); - }; - //#endregion return ( - +
방 공유하기
diff --git a/packages/web/src/pages/Addroom/index.tsx b/packages/web/src/pages/Addroom/index.tsx index 3f1a4a47..415e1079 100644 --- a/packages/web/src/pages/Addroom/index.tsx +++ b/packages/web/src/pages/Addroom/index.tsx @@ -2,7 +2,6 @@ import { useEffect, useMemo, useRef, useState } from "react"; import { useCookies } from "react-cookie"; import { useHistory } from "react-router-dom"; -import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete"; import { useFetchRecoilState, useIsLogin, @@ -64,11 +63,6 @@ const AddRoom = () => { const isLogin = useIsLogin(); const myRooms = useValueRecoilState("myRooms"); const fetchMyRooms = useFetchRecoilState("myRooms"); - //#region event2024fall - const event2024FallQuestComplete = useEvent2024FallQuestComplete(); - const [isOpenModalEventAbuseWarning, setIsOpenModalEventAbuseWarning] = - useState(false); - //#endregion const [taxiFare, setTaxiFare] = useState(0); @@ -140,44 +134,6 @@ const AddRoom = () => { const onClickAdd = async () => { if (!onCall.current) { onCall.current = true; - - // #region event2024fall - let isAgreeOnTermsOfEvent = false; - await axios({ - url: "/events/2024fall/globalState", - method: "get", - onSuccess: (data) => { - if (data.isAgreeOnTermsOfEvent) { - isAgreeOnTermsOfEvent = data.isAgreeOnTermsOfEvent; - } - }, - onError: () => {}, - }); - if (isAgreeOnTermsOfEvent) { - let isFalse = false; - await axios({ - url: "/rooms/create/test", - method: "post", - data: { - from: valuePlace[0], - to: valuePlace[1], - time: calculatedTime!.toISOString(), - maxPartLength: valueMaxPeople, - }, - onSuccess: (data) => { - if (data!.result === false) { - setIsOpenModalEventAbuseWarning(true); - onCall.current = false; - isFalse = true; - return; - } - }, - onError: () => {}, - }); - if (isFalse) return; - } - // #endregion - // FIXME: "/rooms/create" API가 myRoom을 반환하도록 수정 await axios({ url: "/rooms/create", @@ -191,9 +147,6 @@ const AddRoom = () => { }, onSuccess: () => { fetchMyRooms(); - //#region event2024fall - event2024FallQuestComplete("firstRoomCreation"); - //#endregion history.push("/myroom"); }, onError: () => setAlert("방 개설에 실패하였습니다."), @@ -253,37 +206,6 @@ const AddRoom = () => { )} - {/* #region event2024Fall */} - { - if (data === true) { - setIsOpenModalEventAbuseWarning(data); - await axios({ - url: "/rooms/create", - method: "post", - data: { - name: valueName || randomRoomName, - from: valuePlace[0], - to: valuePlace[1], - time: calculatedTime!.toISOString(), - maxPartLength: valueMaxPeople, - }, - onSuccess: () => { - fetchMyRooms(); - //#region event2024fall - event2024FallQuestComplete("firstRoomCreation"); - //#endregion - history.push("/myroom"); - }, - onError: () => setAlert("방 개설에 실패하였습니다."), - }); - } else if (data === false) { - setIsOpenModalEventAbuseWarning(data); - } - }} - /> - {/* #endregion */} ) : ( From 86a55893a4b85ebfd2302df89435462ab51be09c Mon Sep 17 00:00:00 2001 From: jinhyeonkwon Date: Tue, 24 Sep 2024 22:33:50 +0900 Subject: [PATCH 2/2] fix: some faults --- .../ModalPopup/ModalEvent2024FallDailyAttendance.tsx | 4 ++++ .../src/components/ModalPopup/ModalEvent2024FallJoin.tsx | 9 ++++++++- packages/web/src/pages/Addroom/index.tsx | 1 - 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/web/src/components/ModalPopup/ModalEvent2024FallDailyAttendance.tsx b/packages/web/src/components/ModalPopup/ModalEvent2024FallDailyAttendance.tsx index 8dbe2475..c2623250 100644 --- a/packages/web/src/components/ModalPopup/ModalEvent2024FallDailyAttendance.tsx +++ b/packages/web/src/components/ModalPopup/ModalEvent2024FallDailyAttendance.tsx @@ -1,5 +1,6 @@ import { useEffect, useState } from "react"; +import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete"; import { useValueRecoilState } from "@/hooks/useFetchRecoilState"; import Button from "@/components/Button"; @@ -46,6 +47,8 @@ const ModalEvent2024FallDailyAttendance = ({ today.date(), ]); + const event2024FallQuestComplete = useEvent2024FallQuestComplete(); + const { isAgreeOnTermsOfEvent = false, completedQuests = [] } = useValueRecoilState("event2024FallInfo") || {}; @@ -60,6 +63,7 @@ const ModalEvent2024FallDailyAttendance = ({ if (onChangeIsOpen && modalOpened) { onChangeIsOpen(modalOpened); // 모달 열기 상태 변경 + event2024FallQuestComplete("dailyAttendance"); } }, [isAgreeOnTermsOfEvent, todayInitial.length]); diff --git a/packages/web/src/components/ModalPopup/ModalEvent2024FallJoin.tsx b/packages/web/src/components/ModalPopup/ModalEvent2024FallJoin.tsx index 5d20f79b..0ab06ce0 100644 --- a/packages/web/src/components/ModalPopup/ModalEvent2024FallJoin.tsx +++ b/packages/web/src/components/ModalPopup/ModalEvent2024FallJoin.tsx @@ -1,5 +1,6 @@ import { useCallback, useEffect, useMemo, useState } from "react"; +import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete"; import { useFetchRecoilState, useIsLogin, @@ -40,6 +41,9 @@ const ModalEvent2024FallJoin = ({ const { isAgreeOnTermsOfEvent } = useValueRecoilState("event2024FallInfo") || {}; const fetchLoginInfo = useFetchRecoilState("loginInfo"); + //#region event2024fall + const event2024FallQuestComplete = useEvent2024FallQuestComplete(); + //#endregion const [phoneNumber, setPhoneNumber] = useState( phoneNumberFromLoginInfo || "" @@ -79,11 +83,14 @@ const ModalEvent2024FallJoin = ({ data: { phoneNumber, inviter: inviterId }, onSuccess: () => { fetchLoginInfo(); + //#region event2024fall + event2024FallQuestComplete("firstLogin"); + //#endregion modalProps.onChangeIsOpen?.(false); }, onError: () => setAlert("이벤트 참여에 실패하였습니다."), }), - [phoneNumber, setPhoneNumber] + [phoneNumber, setPhoneNumber, event2024FallQuestComplete] ); const styleTitle = { diff --git a/packages/web/src/pages/Addroom/index.tsx b/packages/web/src/pages/Addroom/index.tsx index 415e1079..172a27f3 100644 --- a/packages/web/src/pages/Addroom/index.tsx +++ b/packages/web/src/pages/Addroom/index.tsx @@ -11,7 +11,6 @@ import { useAxios } from "@/hooks/useTaxiAPI"; import AdaptiveDiv from "@/components/AdaptiveDiv"; import Button from "@/components/Button"; -import { ModalEvent2024FallAbuseWarning } from "@/components/ModalPopup"; import { OptionDate, OptionMaxPeople,