From 4ec4441ca53a57d717d2779da0b005ab1169afc0 Mon Sep 17 00:00:00 2001 From: jerry Date: Fri, 9 Aug 2024 10:47:42 +0900 Subject: [PATCH 01/33] =?UTF-8?q?design:=20404=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=EC=97=90=20=EC=82=AC=EC=9A=A9=EB=90=A0=20asset=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/svgs/not_found_asset.svg | 9 +++++++++ src/assets/svgs/NotFoundAsset.tsx | 24 ++++++++++++++++++++++++ src/assets/svgs/index.tsx | 3 ++- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 public/svgs/not_found_asset.svg create mode 100644 src/assets/svgs/NotFoundAsset.tsx diff --git a/public/svgs/not_found_asset.svg b/public/svgs/not_found_asset.svg new file mode 100644 index 00000000..e6239f7c --- /dev/null +++ b/public/svgs/not_found_asset.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/svgs/NotFoundAsset.tsx b/src/assets/svgs/NotFoundAsset.tsx new file mode 100644 index 00000000..aa389604 --- /dev/null +++ b/src/assets/svgs/NotFoundAsset.tsx @@ -0,0 +1,24 @@ +import * as React from "react"; +import type { SVGProps } from "react"; +const SvgNotFoundAsset = (props: SVGProps) => ( + + + + + + + + + +); +export default SvgNotFoundAsset; diff --git a/src/assets/svgs/index.tsx b/src/assets/svgs/index.tsx index fee0ceab..baa30ca0 100644 --- a/src/assets/svgs/index.tsx +++ b/src/assets/svgs/index.tsx @@ -4,6 +4,7 @@ export { default as ButtonDelete24 } from "./ButtonDelete24"; export { default as CarouselPartInactive } from "./CarouselPartInactive"; export { default as Empty } from "./Empty"; export { default as IcHamburgar } from "./IcHamburgar"; +export { default as IcOutlinePlace } from "./IcOutlinePlace"; export { default as IcomCopy } from "./IcomCopy"; export { default as IconArrowDown } from "./IconArrowDown"; export { default as IconArrowLeft } from "./IconArrowLeft"; @@ -54,6 +55,6 @@ export { default as IconToss } from "./IconToss"; export { default as IconWoochaegook } from "./IconWoochaegook"; export { default as IconWoori } from "./IconWoori"; export { default as IconXButton } from "./IconXButton"; -export { default as IcOutlinePlace } from "./IcOutlinePlace"; +export { default as NotFoundAsset } from "./NotFoundAsset"; export { default as Subtract } from "./Subtract"; export { default as Union } from "./Union"; \ No newline at end of file From 323ab2abcd08956001049f85a2d44f42c68c8e5a Mon Sep 17 00:00:00 2001 From: jerry Date: Fri, 9 Aug 2024 10:57:52 +0900 Subject: [PATCH 02/33] =?UTF-8?q?feat:=20404=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=20=EB=9D=BC=EC=9A=B0=ED=8C=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Router.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/routes/Router.tsx b/src/routes/Router.tsx index ea646015..8b9dffaf 100644 --- a/src/routes/Router.tsx +++ b/src/routes/Router.tsx @@ -1,6 +1,7 @@ import Layout from "@components/layout/Layout"; import KakaoAuth from "@pages/kakaoAuth/KakaoAuth"; import Main from "@pages/main/Main"; +import NotFound from "@pages/notFound/NotFound"; import { GIG_ROUTES, LOOKUP_ROUTES, MANAGE_ROUTES, REGISTER_ROUTES, TEST_ROUTES } from "@routes"; import { createBrowserRouter, Navigate } from "react-router-dom"; import TokenRefresher from "src/hooks/useTokenRefresher"; @@ -24,6 +25,7 @@ const router = createBrowserRouter([ ...LOOKUP_ROUTES, ...MANAGE_ROUTES, ...REGISTER_ROUTES, + { path: "*", element: }, ], }, { From 139d740fa2345090d420a1a0baa7964b4207445e Mon Sep 17 00:00:00 2001 From: jerry Date: Fri, 9 Aug 2024 10:58:05 +0900 Subject: [PATCH 03/33] =?UTF-8?q?feat:=20404=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=20=EB=B7=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/notFound/NotFound.styled.ts | 24 ++++++++++++++++++++++ src/pages/notFound/NotFound.tsx | 29 +++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 src/pages/notFound/NotFound.styled.ts create mode 100644 src/pages/notFound/NotFound.tsx diff --git a/src/pages/notFound/NotFound.styled.ts b/src/pages/notFound/NotFound.styled.ts new file mode 100644 index 00000000..32b9ffd4 --- /dev/null +++ b/src/pages/notFound/NotFound.styled.ts @@ -0,0 +1,24 @@ +import { NotFoundAsset } from "@assets/svgs"; +import styled from "styled-components"; + +export const Container = styled.div` + display: flex; + flex-direction: column; + gap: 2.4rem; + align-items: center; + margin-top: 17.5rem; +`; + +export const NotFoundImage = styled(NotFoundAsset)` + width: 17.6rem; + height: 10.9rem; +`; + +export const HeadingText = styled.h3` + ${({ theme }) => theme.fonts.heading3}; +`; + +export const SubText = styled.p` + color: ${({ theme }) => theme.colors.gray_300}; + ${({ theme }) => theme.fonts["body2-normal-medi"]}; +`; diff --git a/src/pages/notFound/NotFound.tsx b/src/pages/notFound/NotFound.tsx new file mode 100644 index 00000000..049ead6d --- /dev/null +++ b/src/pages/notFound/NotFound.tsx @@ -0,0 +1,29 @@ +import { NAVIGATION_STATE } from "@constants/navigationState"; +import { useHeader } from "@hooks"; +import { useEffect } from "react"; +import { useNavigate } from "react-router-dom"; +import * as S from "./NotFound.styled"; + +const NotFound = () => { + const navgigate = useNavigate(); + const { setHeader } = useHeader(); + + useEffect(() => { + setHeader({ + headerStyle: NAVIGATION_STATE.ICON, + rightOnClick: () => { + navgigate("/main"); + }, + }); + }, []); + + return ( + + + 요청하신 페이지를 찾을 수 없어요. + 너 때문에 비트가 다 깨져버렸으니 책임져.! + + ); +}; + +export default NotFound; From 0b8473a31fc2dd352515fef1ad0f69403d55b471 Mon Sep 17 00:00:00 2001 From: ocahs9 Date: Fri, 9 Aug 2024 19:02:17 +0900 Subject: [PATCH 04/33] =?UTF-8?q?feat:=20dueDate=20=EC=88=AB=EC=9E=90?= =?UTF-8?q?=EB=A1=9C=20=EA=B3=84=EC=82=B0=ED=95=9C=20=EB=92=A4,=20?= =?UTF-8?q?=EB=9D=BC=EB=B2=A8=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20?= =?UTF-8?q?=EB=B6=99=EC=97=AC=EC=84=9C=20=EB=84=98=EA=B2=A8=EC=A3=BC?= =?UTF-8?q?=EB=8A=94=20=EB=A1=9C=EC=A7=81=20=EA=B5=AC=ED=98=84=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/myRegisterdShow/MyRegisterdShow.tsx | 2 +- .../registeredcard/RegisteredCard.tsx | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/pages/myRegisterdShow/MyRegisterdShow.tsx b/src/pages/myRegisterdShow/MyRegisterdShow.tsx index 5ba79973..174c1730 100644 --- a/src/pages/myRegisterdShow/MyRegisterdShow.tsx +++ b/src/pages/myRegisterdShow/MyRegisterdShow.tsx @@ -1,5 +1,6 @@ import { useMakerPerformance } from "@apis/domains/performances/queries"; import Button from "@components/commons/button/Button"; +import MetaTag from "@components/commons/meta/MetaTag"; import { NAVIGATION_STATE } from "@constants/navigationState"; import { useHeader } from "@hooks"; import { components } from "@typings/api/schema"; @@ -9,7 +10,6 @@ import bannerNarrow from "../../assets/images/banner_narrow.png"; import * as S from "./MyRegisterdShow.styled"; import RegisteredCard from "./components/registeredcard/RegisteredCard"; import { RegisteredObjProps } from "./constants/myRegisterShow"; -import MetaTag from "@components/commons/meta/MetaTag"; const MyRegisterdShow = () => { const { setHeader } = useHeader(); const navigate = useNavigate(); diff --git a/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx b/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx index f8905fc2..78c9cc8f 100644 --- a/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx +++ b/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx @@ -1,4 +1,5 @@ import Button from "@components/commons/button/Button"; +import Labal from "@components/commons/label/Labal"; import { SHOW_TYPE, SHOW_TYPE_KEY, ShowTypes } from "@pages/gig/constants"; import { useNavigate } from "react-router-dom"; import { RegisteredObjProps } from "../../constants/myRegisterShow"; @@ -25,8 +26,32 @@ const RegisteredCard = ({ const getShowTypeText = (key: SHOW_TYPE_KEY): ShowTypes => SHOW_TYPE[key]; + const calculateDueDate = (dateString: string): number => { + // 문자열이 '~'을 포함하는지 확인 + const endDateStr = dateString.includes("~") + ? dateString.split("~")[1].trim() + : dateString.trim(); + + // 문자열을 Date 객체로 변환 + const endDate = new Date(endDateStr); + + // 현재 날짜를 얻음 + const currentDate = new Date(); + + // 두 날짜 간의 차이를 계산 (밀리초 단위) + const timeDifference = endDate.getTime() - currentDate.getTime(); + + // 밀리초를 일 단위로 변환 + const dayDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24)); + + return dayDifference; + }; + + const dueDate = calculateDueDate(performancePeriod); + return ( + { From 9b1bbc5b737d5438dd32619168ef135b89f131de Mon Sep 17 00:00:00 2001 From: imddoy Date: Sat, 10 Aug 2024 00:03:45 +0900 Subject: [PATCH 05/33] =?UTF-8?q?chore:=20=EC=82=AC=EC=A7=84=20=EB=B9=84?= =?UTF-8?q?=EC=9C=A8=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/gig/components/peopleCard/PeopleCard.styled.ts | 7 ++----- src/pages/gig/components/peopleCard/PeopleCard.tsx | 2 +- src/pages/gig/components/showInfo/ShowInfo.styled.ts | 6 +++--- src/pages/gig/components/showInfo/ShowInfo.tsx | 2 +- .../main/components/performance/Performance.Cardstyled.ts | 1 + 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/pages/gig/components/peopleCard/PeopleCard.styled.ts b/src/pages/gig/components/peopleCard/PeopleCard.styled.ts index d1cb065b..0a67a0fe 100644 --- a/src/pages/gig/components/peopleCard/PeopleCard.styled.ts +++ b/src/pages/gig/components/peopleCard/PeopleCard.styled.ts @@ -5,16 +5,13 @@ export const PeopleCardContainer = styled.article` flex-direction: column; `; -export const PeopleCardPhoto = styled.img<{ $imgsrc: string }>` +export const PeopleCardPhoto = styled.img` width: 15.7rem; - height: 14rem; + height: calc(15.7rem * 4 / 3); margin-bottom: 0.7rem; object-fit: cover; object-position: center; - background-image: url(${({ $imgsrc }) => $imgsrc}); - background-position: center; - background-size: cover; border-radius: 6px; `; diff --git a/src/pages/gig/components/peopleCard/PeopleCard.tsx b/src/pages/gig/components/peopleCard/PeopleCard.tsx index 8acfda13..e5cb0691 100644 --- a/src/pages/gig/components/peopleCard/PeopleCard.tsx +++ b/src/pages/gig/components/peopleCard/PeopleCard.tsx @@ -9,7 +9,7 @@ interface PeopleCardProps { const PeopleCard = ({ photo, role, name }: PeopleCardProps) => { return ( - + {role} {name} diff --git a/src/pages/gig/components/showInfo/ShowInfo.styled.ts b/src/pages/gig/components/showInfo/ShowInfo.styled.ts index 0232a5ab..adfd8721 100644 --- a/src/pages/gig/components/showInfo/ShowInfo.styled.ts +++ b/src/pages/gig/components/showInfo/ShowInfo.styled.ts @@ -5,13 +5,13 @@ export const ShowInfoWrapper = styled.section` ${Generators.flexGenerator("column", "center", "flex-start")}; `; -export const Poster = styled.img<{ $imgsrc: string }>` +export const Poster = styled.img` width: 14.7rem; height: 19.8rem; margin: 1.2rem 0; + object-fit: cover; + object-position: center; - background-image: url(${({ $imgsrc }) => $imgsrc}); - background-size: 100% 100%; border-radius: 4px; `; diff --git a/src/pages/gig/components/showInfo/ShowInfo.tsx b/src/pages/gig/components/showInfo/ShowInfo.tsx index 5c426740..245305aa 100644 --- a/src/pages/gig/components/showInfo/ShowInfo.tsx +++ b/src/pages/gig/components/showInfo/ShowInfo.tsx @@ -38,7 +38,7 @@ const ShowInfo = ({ return ( - + {title}
diff --git a/src/pages/main/components/performance/Performance.Cardstyled.ts b/src/pages/main/components/performance/Performance.Cardstyled.ts index 456760a1..60212f8a 100644 --- a/src/pages/main/components/performance/Performance.Cardstyled.ts +++ b/src/pages/main/components/performance/Performance.Cardstyled.ts @@ -15,6 +15,7 @@ export const PerformanceImg = styled.img` width: 15.7rem; height: 22.4rem; + background-color: black; border-radius: 0.6rem; `; From da461ca973094c6b012835fcc71ed1d8409cc312 Mon Sep 17 00:00:00 2001 From: imddoy Date: Sat, 10 Aug 2024 00:29:43 +0900 Subject: [PATCH 06/33] =?UTF-8?q?chore:=20=EC=98=88=EB=A7=A4=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20=ED=8F=AC=EC=8A=A4=ED=84=B0=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=ED=83=9C=EA=B7=B8=20src=20=EC=86=8D=EC=84=B1=20?= =?UTF-8?q?=EC=9D=B4=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/book/components/info/Info.styled.ts | 4 +--- src/pages/book/components/info/Info.tsx | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pages/book/components/info/Info.styled.ts b/src/pages/book/components/info/Info.styled.ts index 80c31b01..3886633b 100644 --- a/src/pages/book/components/info/Info.styled.ts +++ b/src/pages/book/components/info/Info.styled.ts @@ -12,13 +12,11 @@ export const InfoTop = styled.div` display: flex; `; -export const InfoPoster = styled.img<{ $imgsrc: string }>` +export const InfoPoster = styled.img` width: 9.5rem; height: 12.8rem; margin-right: 1.4rem; - background-image: url(${({ $imgsrc }) => $imgsrc}); - background-size: 100% 100%; border-radius: 4px; `; diff --git a/src/pages/book/components/info/Info.tsx b/src/pages/book/components/info/Info.tsx index 8ecb68d4..209b790a 100644 --- a/src/pages/book/components/info/Info.tsx +++ b/src/pages/book/components/info/Info.tsx @@ -20,7 +20,7 @@ const Info = ({ genre, title, posterImage, teamName, venue, period }: InfoProps) return ( - + From 44eaefed30aff894e0494e24eade758018381e15 Mon Sep 17 00:00:00 2001 From: ocahs9 Date: Sat, 10 Aug 2024 03:08:10 +0900 Subject: [PATCH 07/33] =?UTF-8?q?fix:=20=EB=B0=80=EB=A6=AC=EC=B4=88=20?= =?UTF-8?q?=EB=8B=A8=EC=9C=84=20=EA=B3=84=EC=82=B0=EC=9D=80=20=EC=A0=9C?= =?UTF-8?q?=EC=99=B8=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../registeredcard/RegisteredCard.tsx | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx b/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx index 78c9cc8f..fd789c68 100644 --- a/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx +++ b/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx @@ -25,26 +25,29 @@ const RegisteredCard = ({ }; const getShowTypeText = (key: SHOW_TYPE_KEY): ShowTypes => SHOW_TYPE[key]; - const calculateDueDate = (dateString: string): number => { - // 문자열이 '~'을 포함하는지 확인 - const endDateStr = dateString.includes("~") + //문자열이 ~ 를 포함하는지 확인 (즉, 단일 문자인지 아닌지 확인) + const endDateString = dateString.includes("~") ? dateString.split("~")[1].trim() : dateString.trim(); - // 문자열을 Date 객체로 변환 - const endDate = new Date(endDateStr); - - // 현재 날짜를 얻음 - const currentDate = new Date(); + //해당 날짜를 표준 형식(YYYY-MM-DD) 형식으로 변환 (물론 YYYY.MM.DD도 인식되긴 함 -표준은 아님) + const [year, month, day] = endDateString.split(".").map(Number); //숫자로 저장 + const endDate = new Date(year, month - 1, day); //month는 0부터 시작하므로 -1 해줌 - // 두 날짜 간의 차이를 계산 (밀리초 단위) - const timeDifference = endDate.getTime() - currentDate.getTime(); + //현재 시간을 얻은 뒤, 밀리초 계산은 배제하기 위해 연,월,일로 현재 날짜의 Date 객체 재생성 + const nowDate = new Date(); + const nowYear = nowDate.getFullYear(); + const nowMonth = nowDate.getMonth(); + const nowDay = nowDate.getDate(); //getDay는 요일을 반환하는거니까, 헷갈리지 말자 !! + const startDate = new Date(nowYear, nowMonth, nowDay); - // 밀리초를 일 단위로 변환 - const dayDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24)); + //두 날짜간의 차이를 계산 + const timeDiff = endDate.getTime() - startDate.getTime(); - return dayDifference; + //계산값을 일 단위로 변환(floor를 이용해 내림) + const dayDiff = Math.floor(timeDiff / (1000 * 3600 * 24)); + return dayDiff; }; const dueDate = calculateDueDate(performancePeriod); From d982add1037e808d5bee1e9a0da88cdaf82cb4e2 Mon Sep 17 00:00:00 2001 From: ocahs9 Date: Sat, 10 Aug 2024 03:11:06 +0900 Subject: [PATCH 08/33] =?UTF-8?q?fix:=20=EB=9D=BC=EB=B2=A8=20=EC=9C=84?= =?UTF-8?q?=EC=B9=98=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../registeredcard/RegisteredCard.tsx | 58 ++++++++++--------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx b/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx index fd789c68..52e80084 100644 --- a/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx +++ b/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx @@ -53,39 +53,41 @@ const RegisteredCard = ({ const dueDate = calculateDueDate(performancePeriod); return ( - + <> - { - navigate(`/gig/${performanceId}`); - }} - /> - - + { navigate(`/gig/${performanceId}`); }} - > - - {getShowTypeText(genre as SHOW_TYPE_KEY)} - {performanceTitle} - + /> + + { + navigate(`/gig/${performanceId}`); + }} + > + + {getShowTypeText(genre as SHOW_TYPE_KEY)} + {performanceTitle} + - {performancePeriod} - - - - - - - - - + {performancePeriod} + + + + + + + + + + ); }; From 35378478efddcc8dcd407077462d423a5b9cdfe2 Mon Sep 17 00:00:00 2001 From: jerry Date: Sat, 10 Aug 2024 15:35:53 +0900 Subject: [PATCH 09/33] =?UTF-8?q?fix:=20=ED=98=84=EC=9E=AC=20=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=EC=9D=B4=20=EB=A7=88=EC=A7=80=EB=A7=89=20=EA=B3=B5?= =?UTF-8?q?=EC=97=B0=20=EC=8B=9C=EA=B0=84=EB=B3=B4=EB=8B=A4=20=ED=81=AC?= =?UTF-8?q?=EB=A9=B4=20=EC=98=88=EB=A7=A4=20=EB=B2=84=ED=8A=BC=20=EB=B9=84?= =?UTF-8?q?=ED=99=9C=EC=84=B1=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/gig/Gig.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/pages/gig/Gig.tsx b/src/pages/gig/Gig.tsx index 752a6a5b..b88891c0 100644 --- a/src/pages/gig/Gig.tsx +++ b/src/pages/gig/Gig.tsx @@ -1,6 +1,7 @@ import { useGetPerformanceDetail } from "@apis/domains/performances/queries"; import { ActionBottomSheet, Button, Loading } from "@components/commons"; import OuterLayout from "@components/commons/bottomSheet/OuterLayout"; +import MetaTag from "@components/commons/meta/MetaTag"; import { NAVIGATION_STATE } from "@constants/navigationState"; import { useHeader, useLogin } from "@hooks"; import { navigateAtom } from "@stores"; @@ -12,7 +13,6 @@ import Content from "./components/content/Content"; import ShowInfo from "./components/showInfo/ShowInfo"; import { SHOW_TYPE_KEY } from "./constants"; import * as S from "./Gig.styled"; -import MetaTag from "@components/commons/meta/MetaTag"; const Gig = () => { const navigate = useNavigate(); @@ -25,12 +25,18 @@ const Gig = () => { const [isSheetOpen, setIsSheetOpen] = useState(false); + const nowDate = new Date(); + const lastPerformanceDate = new Date( + data?.scheduleList[data?.scheduleList.length - 1]?.performanceDate + ); + // 현재 시간이 마지막 공연 시간보다 크면 예매 버튼 비활성화 + const isBookDisabled = nowDate > lastPerformanceDate; + const handleBookClick = () => { if (isLogin) { navigate(`/book/${performanceId}`); return; } - setIsSheetOpen(true); }; @@ -86,7 +92,9 @@ const Gig = () => { staffList={data?.staffList ?? []} /> - + Date: Sat, 10 Aug 2024 15:36:53 +0900 Subject: [PATCH 10/33] =?UTF-8?q?fix:=20=EC=A2=85=EB=A3=8C=EB=90=9C=20?= =?UTF-8?q?=EA=B3=B5=EC=97=B0=20=EC=98=88=EB=A7=A4=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EC=A0=91=EA=B7=BC=EC=8B=9C,=20=EB=A9=94=EC=9D=B8?= =?UTF-8?q?=20=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A1=9C=20=EB=A6=AC=EB=8B=A4?= =?UTF-8?q?=EC=9D=B4=EB=A0=89=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/book/Book.tsx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/pages/book/Book.tsx b/src/pages/book/Book.tsx index f10f7203..e4f365b0 100644 --- a/src/pages/book/Book.tsx +++ b/src/pages/book/Book.tsx @@ -8,13 +8,13 @@ import { useGetScheduleAvailable, } from "@apis/domains/performances/queries"; import { Button, Context, Loading, OuterLayout, ViewBottomSheet } from "@components/commons"; +import MetaTag from "@components/commons/meta/MetaTag"; import { NAVIGATION_STATE } from "@constants/navigationState"; import { useHeader, useLogin, useModal } from "@hooks"; import { BookerInfo, Count, EasyPassEntry, Info, Select, TermCheck } from "@pages/book/components"; import { SHOW_TYPE_KEY } from "@pages/gig/constants"; import * as S from "./Book.styled"; import { getScheduleNumberById } from "./utils"; -import MetaTag from "@components/commons/meta/MetaTag"; const Book = () => { const navigate = useNavigate(); @@ -26,6 +26,24 @@ const Book = () => { const { isLogin } = useLogin(); const { setHeader } = useHeader(); + useEffect(() => { + if (data) { + const nowDate = new Date(); + const lastPerformanceDate = new Date( + data.scheduleList[data?.scheduleList.length - 1].performanceDate + ); + if (nowDate > lastPerformanceDate) { + openAlert({ + title: "종료된 공연입니다.", + okText: "확인", + okCallback: () => { + navigate("/main"); + }, + }); + } + } + }, [data]); + useEffect(() => { setHeader({ headerStyle: NAVIGATION_STATE.ICON_TITLE_SUB_TEXT, From 8a75b3563f3ed741c03b703d949339be1e654fbf Mon Sep 17 00:00:00 2001 From: jerry Date: Sat, 10 Aug 2024 16:07:19 +0900 Subject: [PATCH 11/33] =?UTF-8?q?fix:=20Floating=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=9A=B0=EC=B8=A1=20=ED=95=98=EB=8B=A8=EC=97=90=20=EA=B3=A0?= =?UTF-8?q?=EC=A0=95=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/floating/Floating.styled.ts | 16 ++++---- .../main/components/floating/Floating.tsx | 39 ++++++++++++++++--- 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/src/pages/main/components/floating/Floating.styled.ts b/src/pages/main/components/floating/Floating.styled.ts index 0e211977..c2d59595 100644 --- a/src/pages/main/components/floating/Floating.styled.ts +++ b/src/pages/main/components/floating/Floating.styled.ts @@ -1,5 +1,5 @@ +import { BtnFloating, Union } from "@assets/svgs"; import styled, { keyframes } from "styled-components"; -import { Union, BtnFloating } from "@assets/svgs"; const float = keyframes` 0% { @@ -13,15 +13,15 @@ const float = keyframes` } `; -export const Layer = styled.section` - position: relative; -`; - -export const FloatingWrapper = styled.section` +export const Layer = styled.section<{ $width: number }>` position: fixed; - right: 0.3rem; bottom: 15rem; + left: ${({ $width }) => `${$width / 2 + 50}px`}; z-index: 25; +`; + +export const FloatingWrapper = styled.section` + position: absolute; display: flex; flex-direction: column; @@ -29,8 +29,6 @@ export const FloatingWrapper = styled.section` `; export const FloatingContainer = styled.section` - position: absolute; - right: 2.4rem; display: flex; flex-direction: column; gap: 0.8rem; diff --git a/src/pages/main/components/floating/Floating.tsx b/src/pages/main/components/floating/Floating.tsx index 677b1a33..e56fee9a 100644 --- a/src/pages/main/components/floating/Floating.tsx +++ b/src/pages/main/components/floating/Floating.tsx @@ -1,20 +1,47 @@ +import { useLogin, useModal } from "@hooks"; +import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; import * as S from "./Floating.styled"; const Floating = () => { const navigate = useNavigate(); + const { isLogin } = useLogin(); + const { openAlert } = useModal(); + + const handleRegister = () => { + if (isLogin) { + navigate("/gig-register"); + } else { + openAlert({ + title: "로그인이 필요한 서비스입니다.", + okText: "확인", + okCallback: () => { + navigate("/main"); + }, + }); + } + }; + + const [width, setWidth] = useState(window.innerWidth); + + useEffect(() => { + const handleResize = () => { + setWidth(window.innerWidth); + }; + + window.addEventListener("resize", handleResize); + return () => { + window.removeEventListener("resize", handleResize); + }; + }, []); return ( - + 공연을 등록해보세요! - { - navigate("/gig-register"); - }} - > + From 42ca7b6ea1d6efe6924595b2a4e94f51c6c79412 Mon Sep 17 00:00:00 2001 From: jerry Date: Sat, 10 Aug 2024 16:09:53 +0900 Subject: [PATCH 12/33] =?UTF-8?q?fix:=20=EA=B3=B5=EC=97=B0=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=B0=94=EB=A1=9C=20?= =?UTF-8?q?=EC=B9=B4=EC=B9=B4=EC=98=A4=20=EB=A1=9C=EA=B7=B8=EC=9D=B8?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=A6=AC=EB=8B=A4=EC=9D=B4=EB=A0=89?= =?UTF-8?q?=ED=8A=B8=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/register/Register.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pages/register/Register.tsx b/src/pages/register/Register.tsx index c99f3852..a2ac3e49 100644 --- a/src/pages/register/Register.tsx +++ b/src/pages/register/Register.tsx @@ -8,6 +8,7 @@ import InputBank from "@components/commons/bank/InputBank"; import Button from "@components/commons/button/Button"; import TextArea from "@components/commons/input/textArea/TextArea"; import TextField from "@components/commons/input/textField/TextField"; +import MetaTag from "@components/commons/meta/MetaTag"; import Spacing from "@components/commons/spacing/Spacing"; import Stepper from "@components/commons/stepper/Stepper"; import TimePicker from "@components/commons/timepicker/TimePicker"; @@ -46,7 +47,6 @@ import { onMinusClick, onPlusClick, } from "./utils/handleEvent"; -import MetaTag from "@components/commons/meta/MetaTag"; const Register = () => { const { isLogin } = useLogin(); @@ -55,19 +55,18 @@ const Register = () => { const user = localStorage?.getItem("user"); const [, setNavigateUrl] = useAtom(navigateAtom); + const handleKakaoLogin = (url: string) => { setNavigateUrl(url); requestKakaoLogin(); }; - useEffect(() => { - const userObj = JSON.parse(user); - if (userObj === null) { + useEffect(() => { + if (!isLogin) { openAlert({ title: "로그인이 필요한 서비스입니다.", okCallback: () => navigate("/main"), }); - handleKakaoLogin("/gig-register"); } }, []); From 5337b6cf4946bfa2f04c248fc555a7feea5c4c59 Mon Sep 17 00:00:00 2001 From: jerry Date: Sat, 10 Aug 2024 16:10:15 +0900 Subject: [PATCH 13/33] =?UTF-8?q?fix:=20=EB=B0=B0=EB=84=88=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=EC=8B=9C,=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=97=AC?= =?UTF-8?q?=EB=B6=80=20=ED=99=95=EC=9D=B8=20=EB=A1=9C=EC=A7=81=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/components/performance/Performance.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pages/main/components/performance/Performance.tsx b/src/pages/main/components/performance/Performance.tsx index 11d87c8f..5817362f 100644 --- a/src/pages/main/components/performance/Performance.tsx +++ b/src/pages/main/components/performance/Performance.tsx @@ -2,6 +2,7 @@ import { useNavigate } from "react-router-dom"; import * as S from "./Performance.styled"; import Spacing from "@components/commons/spacing/Spacing"; +import { useLogin, useModal } from "@hooks"; import BannerImg from "../../../../assets/images/banner_basic.png"; import PerformnaceCard from "./PerformnaceCard"; @@ -21,9 +22,18 @@ interface PerformanceComponentProps { const Performance = ({ genre, performanceList = [] }: PerformanceComponentProps) => { const navigate = useNavigate(); + const { isLogin } = useLogin(); + const { openAlert } = useModal(); const handleNavigate = () => { - navigate("/gig-register"); + if (isLogin) { + navigate("/gig-register"); + } else { + openAlert({ + title: "로그인이 필요한 서비스입니다.", + okText: "확인", + }); + } }; const filteredData = From fb612b7a5143a7534a8bb48a094582ba82ecbb4d Mon Sep 17 00:00:00 2001 From: ocahs9 Date: Sun, 11 Aug 2024 01:25:20 +0900 Subject: [PATCH 14/33] =?UTF-8?q?fix:=20=EC=98=88=EB=A7=A4=EC=9E=90=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C,=20=EC=9E=85=EA=B8=88=EC=97=AC=EB=B6=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20api=20=EC=A3=BC=EC=86=8C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/domains/tickets/api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apis/domains/tickets/api.ts b/src/apis/domains/tickets/api.ts index ee1bded7..1a9520b3 100644 --- a/src/apis/domains/tickets/api.ts +++ b/src/apis/domains/tickets/api.ts @@ -49,7 +49,7 @@ export const putTicketUpdate = async ( ): Promise => { try { const response: AxiosResponse> = await put( - `tickets/${formData.performanceId}`, + "tickets", formData ); @@ -70,7 +70,7 @@ export const deleteTicketDelete = async ( // console.log("fromdata", formData); try { const response: AxiosResponse> = await del( - `tickets/${formData.performanceId}`, + "tickets", //DELETE요청의 경우 두번째 인자가 좀 다름. - config 파일을 넣어야 함 { data: formData } ); From f94565aca1aab6a2de9b69e9afaf47a2789298b6 Mon Sep 17 00:00:00 2001 From: jerry Date: Sun, 11 Aug 2024 17:57:28 +0900 Subject: [PATCH 15/33] =?UTF-8?q?feat:=20404=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=20=EC=A0=91=EA=B7=BC=EC=8B=9C,=205=EC=B4=88=20=ED=9B=84=20main?= =?UTF-8?q?=20=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/notFound/NotFound.styled.ts | 5 +++++ src/pages/notFound/NotFound.tsx | 22 +++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/pages/notFound/NotFound.styled.ts b/src/pages/notFound/NotFound.styled.ts index 32b9ffd4..99c4a514 100644 --- a/src/pages/notFound/NotFound.styled.ts +++ b/src/pages/notFound/NotFound.styled.ts @@ -22,3 +22,8 @@ export const SubText = styled.p` color: ${({ theme }) => theme.colors.gray_300}; ${({ theme }) => theme.fonts["body2-normal-medi"]}; `; + +export const CountdownText = styled.p` + color: ${({ theme }) => theme.colors.gray_300}; + ${({ theme }) => theme.fonts["body2-normal-medi"]}; +`; diff --git a/src/pages/notFound/NotFound.tsx b/src/pages/notFound/NotFound.tsx index 049ead6d..936a602e 100644 --- a/src/pages/notFound/NotFound.tsx +++ b/src/pages/notFound/NotFound.tsx @@ -1,20 +1,35 @@ import { NAVIGATION_STATE } from "@constants/navigationState"; import { useHeader } from "@hooks"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; import * as S from "./NotFound.styled"; const NotFound = () => { - const navgigate = useNavigate(); + const navigate = useNavigate(); const { setHeader } = useHeader(); + const [secondsLeft, setSecondsLeft] = useState(5); useEffect(() => { setHeader({ headerStyle: NAVIGATION_STATE.ICON, rightOnClick: () => { - navgigate("/main"); + navigate("/main"); }, }); + + const interval = setInterval(() => { + setSecondsLeft((prev) => prev - 1); + }, 1000); + + // 5초 후에 main 페이지로 이동 + const timer = setTimeout(() => { + navigate("/main"); + }, 5000); + + return () => { + clearInterval(interval); + clearTimeout(timer); + }; }, []); return ( @@ -22,6 +37,7 @@ const NotFound = () => { 요청하신 페이지를 찾을 수 없어요. 너 때문에 비트가 다 깨져버렸으니 책임져.! + {secondsLeft}초 후에 메인 페이지로 이동합니다. ); }; From 3f33d7832302cde933636eaa3655a4b1a3427e38 Mon Sep 17 00:00:00 2001 From: jerry Date: Sun, 11 Aug 2024 17:58:03 +0900 Subject: [PATCH 16/33] =?UTF-8?q?feat:=20=EC=83=81=EC=84=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EB=B0=8F=20=EC=98=88=EC=95=BD=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=97=90=EC=84=9C=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=97=86=EB=8A=94=20=EA=B2=BD=EC=9A=B0=20404=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=A0=8C=EB=8D=94=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/book/Book.tsx | 19 +++++++++++-------- src/pages/gig/Gig.tsx | 23 +++++++++++++++-------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/pages/book/Book.tsx b/src/pages/book/Book.tsx index f10f7203..979839ef 100644 --- a/src/pages/book/Book.tsx +++ b/src/pages/book/Book.tsx @@ -8,13 +8,14 @@ import { useGetScheduleAvailable, } from "@apis/domains/performances/queries"; import { Button, Context, Loading, OuterLayout, ViewBottomSheet } from "@components/commons"; +import MetaTag from "@components/commons/meta/MetaTag"; import { NAVIGATION_STATE } from "@constants/navigationState"; import { useHeader, useLogin, useModal } from "@hooks"; import { BookerInfo, Count, EasyPassEntry, Info, Select, TermCheck } from "@pages/book/components"; import { SHOW_TYPE_KEY } from "@pages/gig/constants"; +import NotFound from "@pages/notFound/NotFound"; import * as S from "./Book.styled"; import { getScheduleNumberById } from "./utils"; -import MetaTag from "@components/commons/meta/MetaTag"; const Book = () => { const navigate = useNavigate(); @@ -160,12 +161,8 @@ const Book = () => { bookerPhoneNumber: bookerInfo.bookerPhoneNumber, } as GuestBookingRequest; - console.log(formData); - const res = await memberBook(formData); - console.log(res); - navigate("/book/complete", { state: { id: performanceId, @@ -206,9 +203,15 @@ const Book = () => { } }, [isLogin, selectedValue, bookerInfo, easyPassword, isTermChecked]); - return isLoading ? ( - - ) : ( + if (isLoading) { + return ; + } + + if (!data) { + return ; + } + + return ( {isPending && } diff --git a/src/pages/gig/Gig.tsx b/src/pages/gig/Gig.tsx index 752a6a5b..49fa886b 100644 --- a/src/pages/gig/Gig.tsx +++ b/src/pages/gig/Gig.tsx @@ -1,8 +1,10 @@ import { useGetPerformanceDetail } from "@apis/domains/performances/queries"; import { ActionBottomSheet, Button, Loading } from "@components/commons"; import OuterLayout from "@components/commons/bottomSheet/OuterLayout"; +import MetaTag from "@components/commons/meta/MetaTag"; import { NAVIGATION_STATE } from "@constants/navigationState"; import { useHeader, useLogin } from "@hooks"; +import NotFound from "@pages/notFound/NotFound"; import { navigateAtom } from "@stores"; import { requestKakaoLogin } from "@utils/kakaoLogin"; import { useAtom } from "jotai"; @@ -12,7 +14,6 @@ import Content from "./components/content/Content"; import ShowInfo from "./components/showInfo/ShowInfo"; import { SHOW_TYPE_KEY } from "./constants"; import * as S from "./Gig.styled"; -import MetaTag from "@components/commons/meta/MetaTag"; const Gig = () => { const navigate = useNavigate(); @@ -44,19 +45,25 @@ const Gig = () => { }; useEffect(() => { - setHeader({ - headerStyle: NAVIGATION_STATE.ICON_TITLE, - title: data?.performanceTitle, - leftOnClick: () => { - navigate("/main"); - }, - }); + if (data) { + setHeader({ + headerStyle: NAVIGATION_STATE.ICON_TITLE, + title: data?.performanceTitle, + leftOnClick: () => { + navigate("/main"); + }, + }); + } }, [data]); if (isLoading) { return ; } + if (!data) { + return ; + } + return ( Date: Mon, 12 Aug 2024 03:13:11 +0900 Subject: [PATCH 17/33] =?UTF-8?q?test:=20prerender=20api=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=9A=94=EC=B2=AD=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/prerender.ts | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/api/prerender.ts diff --git a/src/api/prerender.ts b/src/api/prerender.ts new file mode 100644 index 00000000..70ae9382 --- /dev/null +++ b/src/api/prerender.ts @@ -0,0 +1,56 @@ +import Prerenderer from "@prerenderer/prerenderer"; +import PuppeteerRenderer from "@prerenderer/renderer-puppeteer"; +import chromium from "@sparticuz/chromium-min"; + +export async function POST(req: Request, res) { + console.log("req is: ", req); + + try { + const body = await readBody(req); + + const { performanceId } = body; + console.log("performanceId is: ", performanceId); + + const chromePath = + process.env.VITE_CHROME_PATH || + (await chromium.executablePath( + "https://github.com/Sparticuz/chromium/releases/download/v121.0.0/chromium-v121.0.0-pack.tar" + )); + + // 프리렌더 작업 수행 + const prerenderer = new Prerenderer({ + staticDir: __dirname, // 정적 파일이 있는 디렉터리 경로 + renderer: new PuppeteerRenderer({ + launchOptions: { + args: ["--no-sandbox", "--disable-setuid-sandbox"], + ignoreDefaultArgs: ["--disable-extensions"], + defaultViewport: chromium.defaultViewport, + executablePath: chromePath, + ignoreHTTPSErrors: true, + headless: chromium.headless, + }, + maxConcurrentRoutes: 1, + renderAfterTime: 500, + }), + }); + + await prerenderer.initialize(); + await prerenderer.renderRoutes([`/gig/${performanceId}`]); + await prerenderer.destroy(); + + res.status(200).json({ message: "Prerender complete", performanceId }); + } catch (error) { + console.error("Error during prerendering:", error); + res.status(500).json({ message: "Error during prerendering", error }); + } +} + +// Request body를 JSON으로 파싱하는 유틸리티 함수 +async function readBody(req) { + const chunks = []; + for await (const chunk of req) { + chunks.push(chunk); + } + const buffer = Buffer.concat(chunks).toString(); + return JSON.parse(buffer); +} From 787fc8cef0e12d8f244163261e9b9ed1ace1d438 Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 12 Aug 2024 03:13:33 +0900 Subject: [PATCH 18/33] =?UTF-8?q?test:=20=EA=B3=B5=EC=97=B0=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=EC=9A=94=EC=B2=AD=EC=8B=9C,=20=ED=94=84=EB=A6=AC?= =?UTF-8?q?=EB=A0=8C=EB=8D=94=20=EC=9E=91=EC=97=85=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/domains/performances/queries.ts | 22 ++++++++++++++++++++-- src/pages/register/Register.tsx | 3 ++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/apis/domains/performances/queries.ts b/src/apis/domains/performances/queries.ts index 571998ad..be0878cd 100644 --- a/src/apis/domains/performances/queries.ts +++ b/src/apis/domains/performances/queries.ts @@ -141,7 +141,7 @@ export const usePostPerformance = () => { return useMutation({ mutationFn: (formData: PerformanceFormData) => postPerformance(formData), - onSuccess: (res) => { + onSuccess: async (res) => { queryClient.invalidateQueries({ queryKey: [HOME_QUERY_KEY.LIST, PERFORMANCE_QUERY_KEY.DETAIL], }); @@ -152,11 +152,29 @@ export const usePostPerformance = () => { }); if (isPerformanceResponse(res) && res.status === 201) { + // 프리렌더 작업 수행 + const prerenderResponse = await fetch("/api/prerender", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ performanceId: res.data.performanceId }), + }); + + console.log("prerenderResponse is: ", prerenderResponse); + + if (prerenderResponse.ok) { + console.log("Prerender successful"); + } else { + console.error("Prerender failed"); + } + + // 등록 완료 페이지로 이동 navigate("/register-complete", { state: { performanceId: res.data.performanceId }, }); } else { - console.error("Unexpected response type", res); + console.error("Performance creation failed:", res); } }, }); diff --git a/src/pages/register/Register.tsx b/src/pages/register/Register.tsx index c99f3852..c2890790 100644 --- a/src/pages/register/Register.tsx +++ b/src/pages/register/Register.tsx @@ -8,6 +8,7 @@ import InputBank from "@components/commons/bank/InputBank"; import Button from "@components/commons/button/Button"; import TextArea from "@components/commons/input/textArea/TextArea"; import TextField from "@components/commons/input/textField/TextField"; +import MetaTag from "@components/commons/meta/MetaTag"; import Spacing from "@components/commons/spacing/Spacing"; import Stepper from "@components/commons/stepper/Stepper"; import TimePicker from "@components/commons/timepicker/TimePicker"; @@ -46,7 +47,6 @@ import { onMinusClick, onPlusClick, } from "./utils/handleEvent"; -import MetaTag from "@components/commons/meta/MetaTag"; const Register = () => { const { isLogin } = useLogin(); @@ -181,6 +181,7 @@ const Register = () => { ...gigInfo.castList.map((cast) => cast.castPhoto), ...gigInfo.staffList.map((staff) => staff.staffPhoto), ]; + try { const res = await Promise.all( S3Urls.map(async (url, index) => { From d17a06bc6d3e1addb0f5930abac39213d514fb62 Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 12 Aug 2024 03:21:03 +0900 Subject: [PATCH 19/33] =?UTF-8?q?fix:=20prerender=20=EC=9E=91=EC=97=85=20?= =?UTF-8?q?=EC=9A=94=EC=B2=AD=20=EA=B2=BD=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/domains/performances/queries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apis/domains/performances/queries.ts b/src/apis/domains/performances/queries.ts index be0878cd..46832374 100644 --- a/src/apis/domains/performances/queries.ts +++ b/src/apis/domains/performances/queries.ts @@ -153,7 +153,7 @@ export const usePostPerformance = () => { if (isPerformanceResponse(res) && res.status === 201) { // 프리렌더 작업 수행 - const prerenderResponse = await fetch("/api/prerender", { + const prerenderResponse = await fetch(`${import.meta.env.VITE_CLIENT_URL}/api/prerender`, { method: "POST", headers: { "Content-Type": "application/json", From 15a3ac8e8e62ca9c93bd3d8c98c7b62952d71dec Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 12 Aug 2024 03:35:09 +0900 Subject: [PATCH 20/33] =?UTF-8?q?test:=20prerender=20=EC=9A=94=EC=B2=AD=20?= =?UTF-8?q?=EA=B2=BD=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {src/api => api}/prerender.ts | 0 tsconfig.app.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename {src/api => api}/prerender.ts (100%) diff --git a/src/api/prerender.ts b/api/prerender.ts similarity index 100% rename from src/api/prerender.ts rename to api/prerender.ts diff --git a/tsconfig.app.json b/tsconfig.app.json index baecdb52..fc82c1fa 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -38,5 +38,5 @@ "@utils/*": ["src/utils/*"] } }, - "include": ["src", "global.d.ts"] + "include": ["src", "global.d.ts", "api"] } From 36ece07d7c555d2feda34b31fa6858efa2e956a7 Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 12 Aug 2024 03:44:21 +0900 Subject: [PATCH 21/33] =?UTF-8?q?test:=20serverless=20function=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=9A=94=EC=B2=AD=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/hello.ts | 3 +++ src/pages/main/Main.tsx | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/api/hello.ts diff --git a/src/api/hello.ts b/src/api/hello.ts new file mode 100644 index 00000000..160a5db6 --- /dev/null +++ b/src/api/hello.ts @@ -0,0 +1,3 @@ +export function GET(request: Request) { + return new Response("Hello from test"); +} diff --git a/src/pages/main/Main.tsx b/src/pages/main/Main.tsx index 86a822a3..d6c4e916 100644 --- a/src/pages/main/Main.tsx +++ b/src/pages/main/Main.tsx @@ -26,12 +26,30 @@ const Main = () => { setGenre(value); }; + const onclickTest = async () => { + const res = await fetch(`${import.meta.env.VITE_CLIENT_URL}/api/prerender`, { + method: "GET", + headers: { + "Content-Type": "application/json", + }, + }); + + console.log("testres is: ", res); + + if (res.ok) { + console.log("testres successful"); + } else { + console.error("testres failed"); + } + }; + return ( <> {isLoading ? ( ) : ( + From 7914166569fdf7105f025518fb4c1557098c1e42 Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 12 Aug 2024 03:47:26 +0900 Subject: [PATCH 22/33] =?UTF-8?q?test:=20test=20=EC=9A=94=EC=B2=AD=20?= =?UTF-8?q?=EA=B2=BD=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/main/Main.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/main/Main.tsx b/src/pages/main/Main.tsx index d6c4e916..613f50ab 100644 --- a/src/pages/main/Main.tsx +++ b/src/pages/main/Main.tsx @@ -27,7 +27,7 @@ const Main = () => { }; const onclickTest = async () => { - const res = await fetch(`${import.meta.env.VITE_CLIENT_URL}/api/prerender`, { + const res = await fetch("/api/hello", { method: "GET", headers: { "Content-Type": "application/json", From 0fa076508372edb655410c1bc4f635266a5a954c Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 12 Aug 2024 03:58:52 +0900 Subject: [PATCH 23/33] =?UTF-8?q?test:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/hello.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/hello.ts b/src/api/hello.ts index 160a5db6..4b6d03c9 100644 --- a/src/api/hello.ts +++ b/src/api/hello.ts @@ -1,3 +1,4 @@ export function GET(request: Request) { + console.log("hi im test"); return new Response("Hello from test"); } From da5aa8dbe31bdffe46c606a5546a65da5936f75c Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 12 Aug 2024 12:50:20 +0900 Subject: [PATCH 24/33] =?UTF-8?q?fix:=20test=20=EC=9A=94=EC=B2=AD=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=EA=B0=92=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/hello.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/hello.ts b/src/api/hello.ts index 4b6d03c9..4b154a48 100644 --- a/src/api/hello.ts +++ b/src/api/hello.ts @@ -1,4 +1,4 @@ -export function GET(request: Request) { +export function GET(request: Request, res) { console.log("hi im test"); - return new Response("Hello from test"); + return res.status(200).json({ message: "Hello from the server!" }); } From e52c291e9cdc7337f8913c1d98aae078af0262fb Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 12 Aug 2024 12:56:50 +0900 Subject: [PATCH 25/33] =?UTF-8?q?fix:=20test=20=EC=9A=94=EC=B2=AD=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=EA=B0=92=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/hello.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/api/hello.ts b/src/api/hello.ts index 4b154a48..8938f22e 100644 --- a/src/api/hello.ts +++ b/src/api/hello.ts @@ -1,4 +1,7 @@ -export function GET(request: Request, res) { +export function GET(request) { console.log("hi im test"); - return res.status(200).json({ message: "Hello from the server!" }); + return new Response(JSON.stringify({ message: "Hello from the server!" }), { + status: 200, + headers: { "Content-Type": "application/json" }, + }); } From 61bde47da6b1b338f10190cbcab50e0417ac20cb Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 12 Aug 2024 13:10:56 +0900 Subject: [PATCH 26/33] =?UTF-8?q?fix:=20=EB=A1=9C=EA=B7=B8=20=EC=B6=9C?= =?UTF-8?q?=EB=A0=A5=20=EA=B0=92=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/main/Main.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/main/Main.tsx b/src/pages/main/Main.tsx index 613f50ab..a8e3c246 100644 --- a/src/pages/main/Main.tsx +++ b/src/pages/main/Main.tsx @@ -34,7 +34,7 @@ const Main = () => { }, }); - console.log("testres is: ", res); + console.log("testres is: ", res.json()); if (res.ok) { console.log("testres successful"); From 1589a5713591214849adc0decb0c7cc70b4d9882 Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 12 Aug 2024 14:52:56 +0900 Subject: [PATCH 27/33] =?UTF-8?q?test:=20hi=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=20=EC=9A=94=EC=B2=AD=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/hi.ts | 8 ++++++++ src/api/hello.ts | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 api/hi.ts diff --git a/api/hi.ts b/api/hi.ts new file mode 100644 index 00000000..d25e5878 --- /dev/null +++ b/api/hi.ts @@ -0,0 +1,8 @@ +export function GET(request) { + console.log("hi im test"); + + return new Response(JSON.stringify({ message: "Hi from the server!" }), { + status: 200, + headers: { "Content-Type": "application/json" }, + }); +} diff --git a/src/api/hello.ts b/src/api/hello.ts index 8938f22e..f0f7e99f 100644 --- a/src/api/hello.ts +++ b/src/api/hello.ts @@ -1,5 +1,6 @@ export function GET(request) { - console.log("hi im test"); + console.log("hello im test"); + return new Response(JSON.stringify({ message: "Hello from the server!" }), { status: 200, headers: { "Content-Type": "application/json" }, From fea7c92f3832c82b0117edd5df8a1e84c572702f Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 12 Aug 2024 14:54:50 +0900 Subject: [PATCH 28/33] =?UTF-8?q?test:=20=EC=9A=94=EC=B2=AD=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/main/Main.tsx | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/pages/main/Main.tsx b/src/pages/main/Main.tsx index a8e3c246..c7ff4f2b 100644 --- a/src/pages/main/Main.tsx +++ b/src/pages/main/Main.tsx @@ -26,7 +26,24 @@ const Main = () => { setGenre(value); }; - const onclickTest = async () => { + const onClickHi = async () => { + const res = await fetch("/api/hello", { + method: "GET", + headers: { + "Content-Type": "application/json", + }, + }); + + console.log("testres is: ", res.json()); + + if (res.ok) { + console.log("testres successful"); + } else { + console.error("testres failed"); + } + }; + + const onClickHello = async () => { const res = await fetch("/api/hello", { method: "GET", headers: { @@ -49,7 +66,12 @@ const Main = () => { ) : ( - + + From 4edd18757b0a1d24b5c859f9df96a0725e964040 Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 12 Aug 2024 15:00:31 +0900 Subject: [PATCH 29/33] =?UTF-8?q?test:=20async=20=ED=82=A4=EC=9B=8C?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/hi.ts | 2 +- src/api/hello.ts | 2 +- src/pages/main/Main.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/hi.ts b/api/hi.ts index d25e5878..ef523f43 100644 --- a/api/hi.ts +++ b/api/hi.ts @@ -1,4 +1,4 @@ -export function GET(request) { +export async function GET(request) { console.log("hi im test"); return new Response(JSON.stringify({ message: "Hi from the server!" }), { diff --git a/src/api/hello.ts b/src/api/hello.ts index f0f7e99f..60018f28 100644 --- a/src/api/hello.ts +++ b/src/api/hello.ts @@ -1,4 +1,4 @@ -export function GET(request) { +export async function GET(request) { console.log("hello im test"); return new Response(JSON.stringify({ message: "Hello from the server!" }), { diff --git a/src/pages/main/Main.tsx b/src/pages/main/Main.tsx index c7ff4f2b..1ff905e7 100644 --- a/src/pages/main/Main.tsx +++ b/src/pages/main/Main.tsx @@ -27,7 +27,7 @@ const Main = () => { }; const onClickHi = async () => { - const res = await fetch("/api/hello", { + const res = await fetch("/api/hi", { method: "GET", headers: { "Content-Type": "application/json", From f497ee57e40541d703ea315ca8326ab525b9343c Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 12 Aug 2024 17:58:07 +0900 Subject: [PATCH 30/33] =?UTF-8?q?chore:=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/notFound/NotFound.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/notFound/NotFound.tsx b/src/pages/notFound/NotFound.tsx index 936a602e..55cf0845 100644 --- a/src/pages/notFound/NotFound.tsx +++ b/src/pages/notFound/NotFound.tsx @@ -36,7 +36,7 @@ const NotFound = () => { 요청하신 페이지를 찾을 수 없어요. - 너 때문에 비트가 다 깨져버렸으니 책임져.! + 너 때문에 비트가 다 깨져버렸으니 책임져! {secondsLeft}초 후에 메인 페이지로 이동합니다. ); From 024d39fe7abd60a2ecfa382a4e0cc56048c19c92 Mon Sep 17 00:00:00 2001 From: ocahs9 Date: Tue, 13 Aug 2024 01:21:11 +0900 Subject: [PATCH 31/33] =?UTF-8?q?fix:=20=EB=9D=BC=EB=B2=A8=20=EC=9C=84?= =?UTF-8?q?=EC=B9=98=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/commons/label/Labal.tsx | 1 - .../components/registeredcard/RegisteredCard.tsx | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/commons/label/Labal.tsx b/src/components/commons/label/Labal.tsx index edfc87c8..a822ff64 100644 --- a/src/components/commons/label/Labal.tsx +++ b/src/components/commons/label/Labal.tsx @@ -1,4 +1,3 @@ -import { ReactNode } from "react"; import * as S from "./Label.styled"; interface LabelProps { diff --git a/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx b/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx index 52e80084..40fb2c91 100644 --- a/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx +++ b/src/pages/myRegisterdShow/components/registeredcard/RegisteredCard.tsx @@ -51,17 +51,18 @@ const RegisteredCard = ({ }; const dueDate = calculateDueDate(performancePeriod); - return ( <> - { navigate(`/gig/${performanceId}`); }} - /> + > + + + { From 9a791585774489194ccada7a868cf47df599af07 Mon Sep 17 00:00:00 2001 From: ocahs9 Date: Tue, 13 Aug 2024 01:29:23 +0900 Subject: [PATCH 32/33] =?UTF-8?q?fix:=20Labal=20=EC=98=A4=ED=83=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20->=20Label?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/commons/index.ts | 2 +- src/components/commons/label/Label.styled.ts | 2 +- src/components/commons/label/{Labal.tsx => Label.tsx} | 4 ++-- src/pages/lookup/components/LookupWrapper.tsx | 4 ++-- src/pages/main/components/performance/PerformnaceCard.tsx | 6 +++--- .../components/registeredcard/RegisteredCard.styled.ts | 1 + .../components/registeredcard/RegisteredCard.tsx | 6 +++--- 7 files changed, 13 insertions(+), 12 deletions(-) rename src/components/commons/label/{Labal.tsx => Label.tsx} (89%) diff --git a/src/components/commons/index.ts b/src/components/commons/index.ts index 3364670d..0d7df5cb 100644 --- a/src/components/commons/index.ts +++ b/src/components/commons/index.ts @@ -14,7 +14,7 @@ export { default as ContextBox } from "./contextBox/ContextBox.tsx"; export { default as Hamburger } from "./hamburger/Hamburger.tsx"; export { default as TextArea } from "./input/textArea/TextArea.tsx"; export { default as TextField } from "./input/textField/TextField.tsx"; -export { default as Labal } from "./label/Labal.tsx"; +export { default as Label } from "./label/Label.tsx"; export { default as Loading } from "./loading/Loading.tsx"; export { default as Alert } from "./modal/Alert.tsx"; export { default as ModalTextBox } from "./modal/components/ModalTextBox.tsx"; diff --git a/src/components/commons/label/Label.styled.ts b/src/components/commons/label/Label.styled.ts index 7708ea96..f300bba8 100644 --- a/src/components/commons/label/Label.styled.ts +++ b/src/components/commons/label/Label.styled.ts @@ -1,5 +1,5 @@ -import styled from "styled-components"; import { Subtract } from "@assets/svgs"; +import styled from "styled-components"; export const LabelWrapper = styled.section` position: absolute; diff --git a/src/components/commons/label/Labal.tsx b/src/components/commons/label/Label.tsx similarity index 89% rename from src/components/commons/label/Labal.tsx rename to src/components/commons/label/Label.tsx index a822ff64..fd385d5a 100644 --- a/src/components/commons/label/Labal.tsx +++ b/src/components/commons/label/Label.tsx @@ -4,7 +4,7 @@ interface LabelProps { dueDate: number; } -const Labal = ({ dueDate }: LabelProps) => { +const Label = ({ dueDate }: LabelProps) => { return ( {dueDate === 0 && ( @@ -30,4 +30,4 @@ const Labal = ({ dueDate }: LabelProps) => { ); }; -export default Labal; +export default Label; diff --git a/src/pages/lookup/components/LookupWrapper.tsx b/src/pages/lookup/components/LookupWrapper.tsx index 9d3c829d..07cedf61 100644 --- a/src/pages/lookup/components/LookupWrapper.tsx +++ b/src/pages/lookup/components/LookupWrapper.tsx @@ -1,8 +1,8 @@ import * as S from "./LookupWrapper.styled"; import Button from "@components/commons/button/Button"; +import Label from "@components/commons/label/Label"; import LookupCard from "./LookupCard"; -import Labal from "@components/commons/label/Labal"; import { LookupProps } from "../types/lookupType"; @@ -12,7 +12,7 @@ const LookupWrapper = ({ handleBtn, ...item }: LookupProps) => { - +