Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#835 이벤트 종료 후 미션 달성 API 호출 관련 코드 삭제 #836

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions packages/web/src/components/ModalPopup/ModalChatPayment.tsx
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -50,9 +49,6 @@ const ModalChatPayment = ({
[userOid, roomInfo]
);
const onCopy = useCallback(() => setIsCopied(true), [setIsCopied]);
//#region event2024Fall
const event2024FallQuestComplete = useEvent2024FallQuestComplete();
//#endregion

useEffect(() => {
if (isCopied) {
Expand All @@ -69,9 +65,6 @@ const ModalChatPayment = ({
method: "post",
data: { roomId: roomInfo._id },
onSuccess: () => {
//#region event2024Fall
event2024FallQuestComplete("farePayment");
//#endregion
modalProps.onChangeIsOpen?.(false);
onRecall?.();
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useCallback, useEffect, useState } from "react";

import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete";
import {
useFetchRecoilState,
useValueRecoilState,
Expand Down Expand Up @@ -32,9 +31,6 @@ const ModalChatSaveAcount = ({
const { account: accountOrigin } = useValueRecoilState("loginInfo") || {};
const [account, setAccount] = useState<string>(accountDefault || "");
const fetchLoginInfo = useFetchRecoilState("loginInfo");
//#region event2024Fall
const event2024FallQuestComplete = useEvent2024FallQuestComplete();
//#endregion

useEffect(() => setAccount(accountDefault || ""), [accountDefault]);

Expand All @@ -45,9 +41,6 @@ const ModalChatSaveAcount = ({
method: "post",
data: { account },
onSuccess: () => {
//#region event2024Fall
event2024FallQuestComplete("accountChanging");
//#endregion
fetchLoginInfo();
},
onError: () => setAlert("계좌번호 저장을 실패하였습니다."),
Expand Down
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -40,7 +39,6 @@ const ModalChatSettlement = ({
const isValidAccount = useMemo(() => regExpTest.account(account), [account]);
const isRequesting = useRef<boolean>(false);
const sendMessage = useSendMessage(roomInfo._id, isRequesting);
const event2024FallQuestComplete = useEvent2024FallQuestComplete();

const onClickOk = () => {
if (isRequesting.current || !isValidAccount) return;
Expand All @@ -57,9 +55,6 @@ const ModalChatSettlement = ({
isRequesting.current = false;
if (account !== defaultAccount) openSaveAccountModal?.(account);
}
//#region event2024Fall
event2024FallQuestComplete("fareSettlement");
//#endregion
modalProps.onChangeIsOpen?.(false);
},
onError: () => {
Expand Down
10 changes: 0 additions & 10 deletions packages/web/src/components/ModalPopup/ModalMypageModify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(() => {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
13 changes: 0 additions & 13 deletions packages/web/src/components/ModalPopup/ModalNotification.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useCallback, useRef } from "react";
import { useTranslation } from "react-i18next";

import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete";
import {
useFetchRecoilState,
useValueRecoilState,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -112,11 +108,6 @@ const ModalNotification = ({
});
fetchNotificationOptions();
isAxiosCalled.current = false;

//#region event2024Fall
if (optionName === "advertisement" && value)
event2024FallQuestComplete("adPushAgreement");
//#endregion
},
[deviceToken]
);
Expand Down Expand Up @@ -148,10 +139,6 @@ const ModalNotification = ({
});
fetchNotificationOptions();
isAxiosCalled.current = false;

//#region event2024Fall
if (value) event2024FallQuestComplete("adPushAgreement");
//#endregion
},
[deviceToken]
);
Expand Down
17 changes: 1 addition & 16 deletions packages/web/src/components/ModalPopup/ModalRoomShare.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete";

import Modal from "@/components/Modal";

import BodyRoomShare, { BodyRoomShareProps } from "./Body/BodyRoomShare";
Expand All @@ -19,9 +17,6 @@ const ModalRoomShare = ({
onChangeIsOpen,
roomInfo,
}: ModalRoomShareProps) => {
//#region event2024Fall
const event2024FallQuestComplete = useEvent2024FallQuestComplete();
//#endregion
const styleTitle = {
...theme.font18,
display: "flex",
Expand All @@ -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 (
<Modal
isOpen={isOpen}
onChangeIsOpen={onChangeIsOpenWithEvent2024Fall}
padding="16px 12px 12px"
>
<Modal isOpen={isOpen} padding="16px 12px 12px">
<div css={styleTitle}>
<ShareRoundedIcon style={styleIcon} />방 공유하기
</div>
Expand Down
79 changes: 0 additions & 79 deletions packages/web/src/pages/Addroom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -12,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,
Expand Down Expand Up @@ -64,11 +62,6 @@ const AddRoom = () => {
const isLogin = useIsLogin();
const myRooms = useValueRecoilState("myRooms");
const fetchMyRooms = useFetchRecoilState("myRooms");
//#region event2024fall
const event2024FallQuestComplete = useEvent2024FallQuestComplete();
const [isOpenModalEventAbuseWarning, setIsOpenModalEventAbuseWarning] =
useState<boolean>(false);
//#endregion

const [taxiFare, setTaxiFare] = useState<number>(0);

Expand Down Expand Up @@ -140,44 +133,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",
Expand All @@ -191,9 +146,6 @@ const AddRoom = () => {
},
onSuccess: () => {
fetchMyRooms();
//#region event2024fall
event2024FallQuestComplete("firstRoomCreation");
//#endregion
history.push("/myroom");
},
onError: () => setAlert("방 개설에 실패하였습니다."),
Expand Down Expand Up @@ -253,37 +205,6 @@ const AddRoom = () => {
)}
</AdaptiveDiv>
</div>
{/* #region event2024Fall */}
<ModalEvent2024FallAbuseWarning
isOpen={isOpenModalEventAbuseWarning}
onChangeIsOpen={async (data) => {
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 */}
</>
) : (
<FullParticipation />
Expand Down