Skip to content

Commit

Permalink
Merge pull request #827 from sparcs-kaist/#823-enable-2024-chuseok-event
Browse files Browse the repository at this point in the history
#823 2024 추석 이벤트: 이벤트 활성화
  • Loading branch information
kmc7468 authored Sep 6, 2024
2 parents d515258 + 44e30d0 commit f6298b3
Show file tree
Hide file tree
Showing 10 changed files with 134 additions and 146 deletions.
11 changes: 5 additions & 6 deletions packages/web/src/components/ModalPopup/ModalChatPayment.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useEffect, useMemo, useRef, useState } from "react";

import useAccountFromChats from "@/hooks/chat/useAccountFromChats";
import { useEvent2024SpringQuestComplete } from "@/hooks/event/useEvent2024SpringQuestComplete";
import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete";
import { useValueRecoilState } from "@/hooks/useFetchRecoilState";
import { useAxios } from "@/hooks/useTaxiAPI";

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

useEffect(() => {
Expand All @@ -69,9 +69,8 @@ const ModalChatPayment = ({
method: "post",
data: { roomId: roomInfo._id },
onSuccess: () => {
//#region event2024Spring
event2024SpringQuestComplete("payingAndSending");
event2024SpringQuestComplete("paying");
//#region event2024Fall
event2024FallQuestComplete("farePayment");
//#endregion
modalProps.onChangeIsOpen?.(false);
onRecall?.();
Expand Down
12 changes: 6 additions & 6 deletions packages/web/src/components/ModalPopup/ModalChatSaveAccount.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, useEffect, useState } from "react";

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

useEffect(() => setAccount(accountDefault || ""), [accountDefault]);
Expand All @@ -45,14 +45,14 @@ const ModalChatSaveAcount = ({
method: "post",
data: { account },
onSuccess: () => {
//#region event2024Spring
event2024SpringQuestComplete("accountChanging");
//#region event2024Fall
event2024FallQuestComplete("accountChanging");
//#endregion
fetchLoginInfo();
},
onError: () => setAlert("계좌번호 저장을 실패하였습니다."),
});
}, [account, event2024SpringQuestComplete]);
}, [account]);

const styleTitle = {
...theme.font18,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMemo, useRef, useState } from "react";

import useSendMessage from "@/hooks/chat/useSendMessage";
import { useEvent2024SpringQuestComplete } from "@/hooks/event/useEvent2024SpringQuestComplete";
import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete";
import { useValueRecoilState } from "@/hooks/useFetchRecoilState";
import { useAxios } from "@/hooks/useTaxiAPI";

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

const onClickOk = () => {
if (isRequesting.current || !isValidAccount) return;
Expand All @@ -57,9 +57,8 @@ const ModalChatSettlement = ({
isRequesting.current = false;
if (account !== defaultAccount) openSaveAccountModal?.(account);
}
//#region event2024Spring
event2024SpringQuestComplete("payingAndSending");
event2024SpringQuestComplete("sending");
//#region event2024Fall
event2024FallQuestComplete("fareSettlement");
//#endregion
modalProps.onChangeIsOpen?.(false);
},
Expand Down
14 changes: 7 additions & 7 deletions packages/web/src/components/ModalPopup/ModalMypageModify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axiosOri from "axios";
import { useCallback, useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next";

import { useEvent2024SpringQuestComplete } from "@/hooks/event/useEvent2024SpringQuestComplete";
import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete";
import {
useFetchRecoilState,
useValueRecoilState,
Expand Down Expand Up @@ -144,8 +144,8 @@ const ModalMypageModify = ({ ...modalProps }: ModalMypageModifyProps) => {

const loginInfo = useValueRecoilState("loginInfo");
const fetchLoginInfo = useFetchRecoilState("loginInfo");
//#region event2024Spring
const event2024SpringQuestComplete = useEvent2024SpringQuestComplete();
//#region event2024Fall
const event2024FallQuestComplete = useEvent2024FallQuestComplete();
//#endregion
const setAlert = useSetRecoilState(alertAtom);

Expand All @@ -169,8 +169,8 @@ const ModalMypageModify = ({ ...modalProps }: ModalMypageModifyProps) => {
method: "post",
data: { nickname },
onError: () => setAlert(t("page_modify.nickname_failed")),
//#region event2024Spring
onSuccess: () => event2024SpringQuestComplete("nicknameChanging"), // event2024Spring
//#region event2024Fall
onSuccess: () => event2024FallQuestComplete("nicknameChanging"), // event2024Fall
//#endregion
});
}
Expand All @@ -181,8 +181,8 @@ const ModalMypageModify = ({ ...modalProps }: ModalMypageModifyProps) => {
method: "post",
data: { account },
onError: () => setAlert(t("page_modify.account_failed")),
//#region event2024Spring
onSuccess: () => event2024SpringQuestComplete("accountChanging"), // event2024Spring
//#region event2024Fall
onSuccess: () => event2024FallQuestComplete("accountChanging"), // event2024Fall
//#endregion
});
}
Expand Down
18 changes: 9 additions & 9 deletions packages/web/src/components/ModalPopup/ModalNotification.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useRef } from "react";
import { useTranslation } from "react-i18next";

import { useEvent2024SpringQuestComplete } from "@/hooks/event/useEvent2024SpringQuestComplete";
import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete";
import {
useFetchRecoilState,
useValueRecoilState,
Expand Down Expand Up @@ -65,8 +65,8 @@ const ModalNotification = ({
const notificationOptions = useValueRecoilState("notificationOptions");
const fetchNotificationOptions = useFetchRecoilState("notificationOptions");
const isAxiosCalled = useRef(false);
//#region event2024Spring
const event2024SpringQuestComplete = useEvent2024SpringQuestComplete();
//#region event2024Fall
const event2024FallQuestComplete = useEvent2024FallQuestComplete();
//#endregion

const styleTitle = {
Expand Down Expand Up @@ -113,12 +113,12 @@ const ModalNotification = ({
fetchNotificationOptions();
isAxiosCalled.current = false;

//#region event2024Spring
//#region event2024Fall
if (optionName === "advertisement" && value)
event2024SpringQuestComplete("adPushAgreement");
event2024FallQuestComplete("adPushAgreement");
//#endregion
},
[deviceToken, event2024SpringQuestComplete]
[deviceToken]
);
const onChangeNotificationAll = useCallback(
async (value: boolean) => {
Expand Down Expand Up @@ -149,11 +149,11 @@ const ModalNotification = ({
fetchNotificationOptions();
isAxiosCalled.current = false;

//#region event2024Spring
if (value) event2024SpringQuestComplete("adPushAgreement");
//#region event2024Fall
if (value) event2024FallQuestComplete("adPushAgreement");
//#endregion
},
[deviceToken, event2024SpringQuestComplete]
[deviceToken]
);
const onChangeNotificationChatting = useCallback(
onChangeNotificationOption("chatting"),
Expand Down
14 changes: 7 additions & 7 deletions packages/web/src/components/ModalPopup/ModalRoomShare.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEvent2024SpringQuestComplete } from "@/hooks/event/useEvent2024SpringQuestComplete";
import { useEvent2024FallQuestComplete } from "@/hooks/event/useEvent2024FallQuestComplete";

import Modal from "@/components/Modal";

Expand All @@ -19,8 +19,8 @@ const ModalRoomShare = ({
onChangeIsOpen,
roomInfo,
}: ModalRoomShareProps) => {
//#region event2024Spring
const event2024SpringQuestComplete = useEvent2024SpringQuestComplete();
//#region event2024Fall
const event2024FallQuestComplete = useEvent2024FallQuestComplete();
//#endregion
const styleTitle = {
...theme.font18,
Expand All @@ -32,17 +32,17 @@ const ModalRoomShare = ({
fontSize: "21px",
margin: "0 4px 0 0",
};
//#region event2024Spring
const onChangeIsOpenWithEvent2023Fall = (isOpen: boolean) => {
//#region event2024Fall
const onChangeIsOpenWithEvent2024Fall = (isOpen: boolean) => {
onChangeIsOpen?.(isOpen);
!isOpen && event2024SpringQuestComplete("roomSharing");
!isOpen && event2024FallQuestComplete("roomSharing");
};
//#endregion

return (
<Modal
isOpen={isOpen}
onChangeIsOpen={onChangeIsOpenWithEvent2023Fall}
onChangeIsOpen={onChangeIsOpenWithEvent2024Fall}
padding="16px 12px 12px"
>
<div css={styleTitle}>
Expand Down
92 changes: 43 additions & 49 deletions packages/web/src/pages/Event/Event2024Fall.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { memo, useEffect, useState } from "react";
import { Link } from "react-router-dom";

import { useValueRecoilState } from "@/hooks/useFetchRecoilState";
import { useAxios } from "@/hooks/useTaxiAPI";
Expand Down Expand Up @@ -26,7 +27,7 @@ import { ReactComponent as MainStep3 } from "@/static/events/2024fallMainStep3.s
import { ReactComponent as MainTitle } from "@/static/events/2024fallMainTitle.svg";

const EVENT_INSTAGRAM_URL =
"https://www.instagram.com/p/C_H7YTfPEGZ/?igsh=MXh3MWc0NnJsZml3MQ==";
"https://www.instagram.com/p/C_j1gibhTOa/?igsh=eWoyMnhweGNzeWR2";

const Event2024Fall = () => {
const [isOpenShare, setIsOpenShare] = useState<boolean>(false);
Expand Down Expand Up @@ -117,19 +118,21 @@ const Event2024Fall = () => {
이벤트 참여 동의만 해도 송편코인 200개 지급
</div>
<div css={{ height: "16px" }} />
{/* <Link to="/event/2024fall-missions" css={{ textDecoration: "none" }}> */}
<Button
disabled
type="purple_inset"
css={{
padding: "14px 0 13px",
borderRadius: "12px",
...theme.font14_bold,
}}
<Link
to="/event/2024fall-missions"
css={{ textDecoration: "none" }}
>
이벤트 시작 후 확인해 보세요!
</Button>
{/* </Link> */}
<Button
type="purple_inset"
css={{
padding: "14px 0 13px",
borderRadius: "12px",
...theme.font14_bold,
}}
>
퀘스트 바로가기
</Button>
</Link>
</WhiteContainer>
<div css={{ height: "16px" }} />
<WhiteContainer
Expand Down Expand Up @@ -168,19 +171,18 @@ const Event2024Fall = () => {
경품 추첨 결과는 9월 30일에 발표
</div>
<div css={{ height: "16px" }} />
{/* <Link to="/event/2024fall-store" css={{ textDecoration: "none" }}> */}
<Button
disabled
type="purple_inset"
css={{
padding: "14px 0 13px",
borderRadius: "12px",
...theme.font14_bold,
}}
>
이벤트 시작 후 확인해 보세요!
</Button>
{/* </Link> */}
<Link to="/event/2024fall-store" css={{ textDecoration: "none" }}>
<Button
type="purple_inset"
css={{
padding: "14px 0 13px",
borderRadius: "12px",
...theme.font14_bold,
}}
>
교환소 구경하기
</Button>
</Link>
</WhiteContainer>
<div css={{ height: "16px" }} />
<WhiteContainer
Expand Down Expand Up @@ -218,23 +220,18 @@ const Event2024Fall = () => {
<br />위 이미지는 실제와 다를 수 있음
</div>
<div css={{ height: "16px" }} />
{/* <Link
to="/event/2024fall-leaderboard"
css={{ textDecoration: "none" }}
> */}
<Button
disabled
type="purple_inset"
css={{
padding: "14px 0 13px",
borderRadius: "12px",
...theme.font14_bold,
}}
>
{/* 응모권 순위 확인하기 */}
이벤트 시작 후 확인해 보세요!
</Button>
{/* </Link> */}
<Link to="/event/2024fall-store" css={{ textDecoration: "none" }}>
<Button
type="purple_inset"
css={{
padding: "14px 0 13px",
borderRadius: "12px",
...theme.font14_bold,
}}
>
응모권 리더보드 확인하기
</Button>
</Link>
</WhiteContainer>
<div css={{ height: "16px" }} />
<WhiteContainer
Expand Down Expand Up @@ -299,7 +296,6 @@ const Event2024Fall = () => {
<div
css={{
background: "linear-gradient(to top, #797F6C, #203F76)",
pointerEvents: "none",
...theme.cursor(),
}}
onClick={() => window.open(EVENT_INSTAGRAM_URL, "_blank")}
Expand All @@ -319,11 +315,9 @@ const Event2024Fall = () => {
<MainSection4 css={{ width: "334px", maxWidth: "100%" }} />
<div css={{ height: "16px" }} />
<div css={{ color: theme.gray_line, ...theme.font14 }}>
{/* 추첨 결과는 인스타그램, Ara, Taxi 홈페이지에 발표
<br />
실물 상품 또는 기프티콘으로 지급
<br /> */}
인스타그램 게시물은 9월 6일 정오에 업로드 예정
이 영역을 누르면 인스타그램 게시물로 이동
<br />
추첨 결과는 인스타그램, Ara, Taxi 홈페이지에 발표
</div>
</AdaptiveDiv>
</div>
Expand Down
Loading

0 comments on commit f6298b3

Please sign in to comment.