Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions src/contexts/authContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export function AuthProvider({ children }: TAuthProviderProps): JSX.Element {
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
}

// eslint-disable-next-line react-refresh/only-export-components
export function useAuth(): TAuthContext {
const context = useContext(AuthContext);
if (context === undefined) {
Expand Down
13 changes: 11 additions & 2 deletions src/pages/artBuyerPage/components/menuMyPage/Auction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ export const ArtBuyerAuction = () => {
navigate(`/auction/${auctionId}`);
};

// status 값을 한글로 변환하는 함수
const getStatusText = (status: string) => {
const statusMap: Record<string, string> = {
BID: '응찰중',
PARTICIPATE: '입찰중',
};
return statusMap[status] || status; // 기본적으로 원래 상태값 유지
};

return (
<AuctionContainer>
<h1>경매</h1>
Expand All @@ -44,9 +53,9 @@ export const ArtBuyerAuction = () => {
{new Date(auction.bid_date).toLocaleDateString('ko-KR')}
</TableCell>
<TableCell>{`₩${auction.bid_price.toLocaleString()}`}</TableCell>
<TableCell>{auction.status}</TableCell>
<TableCell>{getStatusText(auction.status)}</TableCell>
<TableCell>
{auction.status === '응찰중' && (
{auction.status === '입찰중' && (
<AuctionButton
onClick={() => handleBtnClick(auction.auction_id)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ export const Payment = () => {
initiatePayment(paymentId);
};

const getPaymentStatus = (status: string) => {
if (status === 'COMPLETED') return '결제 완료';
if (status === 'PENDING') return '결제 대기중';
return status;
};

return (
<PaymentContainer>
<h1>결제</h1>
Expand All @@ -45,7 +51,7 @@ export const Payment = () => {
<TableCell>
{new Date(payment.created_at).toLocaleDateString('ko-KR')}
</TableCell>
<TableCell>{payment.payment_status}</TableCell>
<TableCell>{getPaymentStatus(payment.payment_status)}</TableCell>
<TableCell>
{payment.payment_status === '결제 대기중' && (
<PaymentButton
Expand Down
2 changes: 1 addition & 1 deletion src/pages/login-redirect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const LoginRedirect = () => {
console.log('provider', provider);
// 소셜 로그인 처리
oauthLoginMutation();
}, []);
}, [code, oauthLoginMutation, provider]);

return (
<PageLayout>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/main/hooks/useCarousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const useCarousel = () => {

const imageTextSrcArray = useMemo(() => {
return [...imageTextArray, imageTextArray[0]];
}, [imageTextArray]);
}, []);

const resetIndexAndTransition = useCallback(() => {
setTimeout(() => {
Expand Down