From 28ece700c40c0c00c0c9068c12555e17c66bb0df Mon Sep 17 00:00:00 2001 From: syddl0 <137189866+shroqkf@users.noreply.github.com> Date: Sat, 15 Feb 2025 15:09:08 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/menuMyPage/Auction/index.tsx | 13 +++++++++++-- .../components/menuMyPage/Payment/index.tsx | 8 +++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/pages/artBuyerPage/components/menuMyPage/Auction/index.tsx b/src/pages/artBuyerPage/components/menuMyPage/Auction/index.tsx index 85d429e..c399fdf 100644 --- a/src/pages/artBuyerPage/components/menuMyPage/Auction/index.tsx +++ b/src/pages/artBuyerPage/components/menuMyPage/Auction/index.tsx @@ -23,6 +23,15 @@ export const ArtBuyerAuction = () => { navigate(`/auction/${auctionId}`); }; + // status 값을 한글로 변환하는 함수 + const getStatusText = (status: string) => { + const statusMap: Record = { + BID: '응찰중', + PARTICIPATE: '입찰중', + }; + return statusMap[status] || status; // 기본적으로 원래 상태값 유지 + }; + return (

경매

@@ -44,9 +53,9 @@ export const ArtBuyerAuction = () => { {new Date(auction.bid_date).toLocaleDateString('ko-KR')} {`₩${auction.bid_price.toLocaleString()}`} - {auction.status} + {getStatusText(auction.status)} - {auction.status === '응찰중' && ( + {auction.status === '입찰중' && ( handleBtnClick(auction.auction_id)} > diff --git a/src/pages/artBuyerPage/components/menuMyPage/Payment/index.tsx b/src/pages/artBuyerPage/components/menuMyPage/Payment/index.tsx index e6ecb49..c3b82d8 100644 --- a/src/pages/artBuyerPage/components/menuMyPage/Payment/index.tsx +++ b/src/pages/artBuyerPage/components/menuMyPage/Payment/index.tsx @@ -24,6 +24,12 @@ export const Payment = () => { initiatePayment(paymentId); }; + const getPaymentStatus = (status: string) => { + if (status === 'COMPLETED') return '결제 완료'; + if (status === 'PENDING') return '결제 대기중'; + return status; + }; + return (

결제

@@ -45,7 +51,7 @@ export const Payment = () => { {new Date(payment.created_at).toLocaleDateString('ko-KR')} - {payment.payment_status} + {getPaymentStatus(payment.payment_status)} {payment.payment_status === '결제 대기중' && ( Date: Sat, 15 Feb 2025 15:13:27 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Fix:=20lint=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/contexts/authContext.tsx | 1 + src/pages/login-redirect/index.tsx | 2 +- src/pages/main/hooks/useCarousel.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/contexts/authContext.tsx b/src/contexts/authContext.tsx index 1f506fb..2b0f9f7 100644 --- a/src/contexts/authContext.tsx +++ b/src/contexts/authContext.tsx @@ -92,6 +92,7 @@ export function AuthProvider({ children }: TAuthProviderProps): JSX.Element { return {children}; } +// eslint-disable-next-line react-refresh/only-export-components export function useAuth(): TAuthContext { const context = useContext(AuthContext); if (context === undefined) { diff --git a/src/pages/login-redirect/index.tsx b/src/pages/login-redirect/index.tsx index 6d5f52a..1d2afe9 100644 --- a/src/pages/login-redirect/index.tsx +++ b/src/pages/login-redirect/index.tsx @@ -16,7 +16,7 @@ export const LoginRedirect = () => { console.log('provider', provider); // 소셜 로그인 처리 oauthLoginMutation(); - }, []); + }, [code, oauthLoginMutation, provider]); return ( diff --git a/src/pages/main/hooks/useCarousel.ts b/src/pages/main/hooks/useCarousel.ts index ea98840..609de8b 100644 --- a/src/pages/main/hooks/useCarousel.ts +++ b/src/pages/main/hooks/useCarousel.ts @@ -8,7 +8,7 @@ export const useCarousel = () => { const imageTextSrcArray = useMemo(() => { return [...imageTextArray, imageTextArray[0]]; - }, [imageTextArray]); + }, []); const resetIndexAndTransition = useCallback(() => { setTimeout(() => {