From 9462a4237496515a17c5c3e832081296875fa85d Mon Sep 17 00:00:00 2001 From: static Date: Fri, 23 Feb 2024 08:17:50 +0900 Subject: [PATCH 1/7] Add: terms of 2024 spring event into my page --- packages/web/src/pages/Mypage/index.tsx | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/web/src/pages/Mypage/index.tsx b/packages/web/src/pages/Mypage/index.tsx index 20483f47e..eabebe601 100644 --- a/packages/web/src/pages/Mypage/index.tsx +++ b/packages/web/src/pages/Mypage/index.tsx @@ -9,6 +9,7 @@ import LinkLogout from "@/components/Link/LinkLogout"; import { ModalCredit, ModalEvent2023FallJoin, + ModalEvent2024SpringJoin, ModalMypageModify, ModalNotification, ModalPrivacyPolicy, @@ -176,11 +177,15 @@ const Mypage = () => { {t("privacy_policy")} - {eventMode === "2023fall" && ( + {eventMode === "2023fall" ? ( 한가위 송편 이벤트 참여 약관 - )} + ) : eventMode === "2024spring" ? ( + + 새내기 택시대제전 참여 약관 + + ) : null} {t("credit")} @@ -197,10 +202,17 @@ const Mypage = () => { onChangeIsOpen={setIsOpenPrivacyPolicy} /> - + {eventMode === "2023fall" ? ( + + ) : eventMode === "2024spring" ? ( + + ) : null} ); From 8e29eca7aac26e38ff5b0f644c2044f21ab04633 Mon Sep 17 00:00:00 2001 From: static Date: Fri, 23 Feb 2024 08:25:22 +0900 Subject: [PATCH 2/7] Refactor: ModalEvent2024SpringJoin.tsx --- .../ModalPopup/ModalEvent2024SpringJoin.tsx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx b/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx index 7b82e8d30..f5242b97e 100644 --- a/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx +++ b/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx @@ -1,5 +1,4 @@ import { useCallback, useEffect, useMemo, useState } from "react"; -import { useLocation } from "react-router-dom"; import { useEvent2024SpringQuestComplete } from "@/hooks/event/useEvent2024SpringQuestComplete"; import { @@ -8,7 +7,6 @@ import { useValueRecoilState, } from "@/hooks/useFetchRecoilState"; import { useAxios } from "@/hooks/useTaxiAPI"; -import useQuery from "@/hooks/useTaxiAPI"; import Button from "@/components/Button"; import DottedLine from "@/components/DottedLine"; @@ -60,7 +58,7 @@ const ModalEvent2024SpringJoin = ({ () => axios({ url: `/events/2024spring/invite/search/${inviterId}`, - method: "post", + method: "get", onSuccess: (data) => { setInvitorInfo(data); }, @@ -69,8 +67,10 @@ const ModalEvent2024SpringJoin = ({ [inviterId] ); + const isInvited = !!inviterId; + useEffect(() => { - if (inviterId) getInvitorInfo(); + if (isInvited) getInvitorInfo(); }, [inviterId]); const isValidPhoneNumber = useMemo( @@ -79,10 +79,6 @@ const ModalEvent2024SpringJoin = ({ ); const isValidGroup = useMemo(() => group > 0 && group < 27, [group]); - const location = useLocation(); - const path = location.pathname; - const isInvited = path.startsWith("/home/startEvent/"); - const onClickJoin = useCallback( () => axios({ @@ -219,7 +215,7 @@ const ModalEvent2024SpringJoin = ({ ) : ( <> - + {(isLogin || (isInvited && inviterInfo)) && } {isLogin && ( <>
@@ -249,7 +245,6 @@ const ModalEvent2024SpringJoin = ({
)} - {isInvited && inviterInfo && (
추천인 From 3615d8bb2cfc1a94a2845e191b0d2dedb8223530 Mon Sep 17 00:00:00 2001 From: static Date: Fri, 23 Feb 2024 08:36:32 +0900 Subject: [PATCH 3/7] Refactor: selectively display terms of events in my page --- .../ModalPopup/ModalEvent2024SpringJoin.tsx | 4 +- packages/web/src/pages/Mypage/index.tsx | 46 +++++++++++-------- packages/web/src/tools/day.ts | 1 + 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx b/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx index f5242b97e..78dcc7290 100644 --- a/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx +++ b/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx @@ -37,9 +37,7 @@ const ModalEvent2024SpringJoin = ({ const isLogin = useIsLogin(); const { phoneNumber: phoneNumberFromLoginInfo } = useValueRecoilState("loginInfo") || {}; - const { isAgreeOnTermsOfEvent } = - useValueRecoilState("event2024SpringInfo") || {}; - const { group: groupFromLoginInfo } = + const { isAgreeOnTermsOfEvent, group: groupFromLoginInfo } = useValueRecoilState("event2024SpringInfo") || {}; const fetchLoginInfo = useFetchRecoilState("loginInfo"); //#region event2024Spring diff --git a/packages/web/src/pages/Mypage/index.tsx b/packages/web/src/pages/Mypage/index.tsx index eabebe601..f2d4e3005 100644 --- a/packages/web/src/pages/Mypage/index.tsx +++ b/packages/web/src/pages/Mypage/index.tsx @@ -32,6 +32,8 @@ const Mypage = () => { const loginInfo = useValueRecoilState("loginInfo"); const notificationOptions = useValueRecoilState("notificationOptions"); const { id: userId } = loginInfo || {}; + const { isAgreeOnTermsOfEvent } = + (eventMode && useValueRecoilState("event2024SpringInfo")) || {}; const [isOpenProfileModify, setIsOpenProfileModify] = useState(false); const [isOpenNotification, setIsOpenNotification] = useState(false); @@ -177,15 +179,17 @@ const Mypage = () => { {t("privacy_policy")} - {eventMode === "2023fall" ? ( - - 한가위 송편 이벤트 참여 약관 - - ) : eventMode === "2024spring" ? ( - - 새내기 택시대제전 참여 약관 - - ) : null} + {eventMode && + isAgreeOnTermsOfEvent && + (eventMode === "2023fall" ? ( + + 한가위 송편 이벤트 참여 약관 + + ) : eventMode === "2024spring" ? ( + + 새내기 택시대제전 참여 약관 + + ) : null)} {t("credit")} @@ -202,17 +206,19 @@ const Mypage = () => { onChangeIsOpen={setIsOpenPrivacyPolicy} /> - {eventMode === "2023fall" ? ( - - ) : eventMode === "2024spring" ? ( - - ) : null} + {eventMode && + isAgreeOnTermsOfEvent && + (eventMode === "2023fall" ? ( + + ) : eventMode === "2024spring" ? ( + + ) : null)} ); diff --git a/packages/web/src/tools/day.ts b/packages/web/src/tools/day.ts index 2f71db9c0..cdb4c2e4e 100644 --- a/packages/web/src/tools/day.ts +++ b/packages/web/src/tools/day.ts @@ -41,6 +41,7 @@ export const day2str = (day: Dayjs, format = "LLLL") => { return day.format(format); }; +/** 일을 기준으로 특정 날짜까지의 D-DAY를 반환합니다. */ export const getDday = (dateString: string) => { const targetDate = dayjs(dateString); const currentDate = dayNowServer().startOf("day"); // Get current server time From b7d3116ebdbae642ce3568cf7a38d1a141c03672 Mon Sep 17 00:00:00 2001 From: static Date: Fri, 23 Feb 2024 08:47:08 +0900 Subject: [PATCH 4/7] Fix: some margin --- .../components/ModalPopup/ModalEvent2024SpringJoin.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx b/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx index 78dcc7290..ee392ed84 100644 --- a/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx +++ b/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx @@ -176,7 +176,7 @@ const ModalEvent2024SpringJoin = ({ 지급됩니다.
-
+
• 본 약관은 동의 이후에도 {'"'}마이페이지{">"}새터반 택시대제전 이벤트 참여 약관{'"'}에서 다시 확인하실 수 있습니다.{" "}
@@ -213,10 +213,14 @@ const ModalEvent2024SpringJoin = ({ ) : ( <> - {(isLogin || (isInvited && inviterInfo)) && } - {isLogin && ( + {(isLogin || (isInvited && inviterInfo)) && ( <>
+ + + )} + {isLogin && ( + <>
전화번호 Date: Fri, 23 Feb 2024 08:56:48 +0900 Subject: [PATCH 5/7] Refactor: margin between input elements --- .../src/components/ModalPopup/ModalEvent2024SpringJoin.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx b/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx index ee392ed84..719562535 100644 --- a/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx +++ b/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx @@ -111,7 +111,7 @@ const ModalEvent2024SpringJoin = ({ margin: "0 8px", }; const styleInputWrap = { - margin: "12px 8px", + margin: "0 8px 12px", display: "flex", alignItems: "center", color: theme.gray_text, @@ -184,6 +184,7 @@ const ModalEvent2024SpringJoin = ({ <>
+
전화번호 )} +
{isLogin && ( <>
From 0ea5bb59eebd916a90144c55d5c01646c8223cc5 Mon Sep 17 00:00:00 2001 From: static Date: Fri, 23 Feb 2024 09:12:31 +0900 Subject: [PATCH 6/7] Refactor: ModalEvent2024SpringJoin.tsx --- .../web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx b/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx index 719562535..8ba3d5b84 100644 --- a/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx +++ b/packages/web/src/components/ModalPopup/ModalEvent2024SpringJoin.tsx @@ -68,7 +68,7 @@ const ModalEvent2024SpringJoin = ({ const isInvited = !!inviterId; useEffect(() => { - if (isInvited) getInvitorInfo(); + if (!isAgreeOnTermsOfEvent && isInvited) getInvitorInfo(); }, [inviterId]); const isValidPhoneNumber = useMemo( From a87f6bcdff273cb71b92ccdbb5dfd48a6920f3af Mon Sep 17 00:00:00 2001 From: static Date: Fri, 23 Feb 2024 09:16:08 +0900 Subject: [PATCH 7/7] Fix: typos in Event2024Spring.tsx --- packages/web/src/pages/Event/Event2024Spring.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/web/src/pages/Event/Event2024Spring.tsx b/packages/web/src/pages/Event/Event2024Spring.tsx index 53fd34f3c..8bcf9bd8e 100644 --- a/packages/web/src/pages/Event/Event2024Spring.tsx +++ b/packages/web/src/pages/Event/Event2024Spring.tsx @@ -309,7 +309,7 @@ const Event2024Spring = () => {
{ }} > - 1등 세터반 + 1등 새터반 - 2등 세터반 + 2등 새터반
{ css={{ textDecoration: "none", width: "100%" }} >