[fix] 판매내역 & 상세 페이지 수정#122
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request removes unused status and shipping fee fields from the product detail screen, cleans up code formatting, and dynamically displays the counterpart's label (seller or buyer) and nickname on the transaction receipt based on the transaction mode. The reviewer suggested refactoring the counterpart nickname assignment in TransactionReceipt.tsx to reduce duplication and improve readability.
| const counterpartNickname = | ||
| mode === "purchase" | ||
| ? data.seller?.nickname ?? data.counterpartNickname ?? "-" | ||
| : data.buyer?.nickname ?? data.counterpartNickname ?? "-"; |
There was a problem hiding this comment.
중복 코드를 줄이고 가독성을 높이기 위해 삼항 연산자를 간결하게 정리할 수 있습니다. data.counterpartNickname ?? "-" 부분이 양쪽 분기에 중복되어 있으므로, 대상 닉네임을 먼저 선택한 후 fallback 처리를 한 번에 적용하는 것이 더 깔끔합니다.
이 제안은 레포지토리 스타일 가이드의 가독성 원칙을 준수하는 데 도움이 됩니다.
| const counterpartNickname = | |
| mode === "purchase" | |
| ? data.seller?.nickname ?? data.counterpartNickname ?? "-" | |
| : data.buyer?.nickname ?? data.counterpartNickname ?? "-"; | |
| const counterpartNickname = | |
| (mode === "purchase" ? data.seller?.nickname : data.buyer?.nickname) ?? | |
| data.counterpartNickname ?? | |
| "-"; |
References
- 가독성을 고려하여 코드를 작성해야 합니다. (link)
There was a problem hiding this comment.
Pull request overview
This PR updates product detail and transaction receipt display logic to remove unused/incorrect product info rows and show the correct counterpart label in purchase vs sales receipts.
Changes:
- Removed the
상태and배송비rows from the regular product detail상품 정보section. - Removed the now-unused
displayStatusvariable. - Updated transaction receipts to display
판매자for purchase receipts and구매자for sales receipts, preferringseller.nickname/buyer.nicknamewith fallback.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/components/transaction-receipt/TransactionReceipt.tsx |
Adds mode-based counterpart label and nickname selection for receipt headers. |
src/app/products/[productId]/index.tsx |
Removes unused product info fields and includes formatting-only cleanup around existing auction logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🚀 Summary
일반 상품 상세 페이지의 상품 정보 항목을 정리하고, 판매/구매내역 영수증에서 상대방 라벨이 올바르게 표시되도록 수정했습니다.
✨ Description
상품 정보섹션에서상태항목을 제거했습니다.상품 정보섹션에서배송비항목을 제거했습니다.상태항목 제거로 더 이상 사용하지 않는displayStatus변수를 정리했습니다.mode기준으로 분기하도록 수정했습니다.판매자구매자seller.nickname또는buyer.nickname을 우선 사용하고, 없을 경우 기존counterpartNickname을 fallback으로 사용하도록 했습니다.🎲 Issue Number
close #{Issue Number}