[fix] 상품 상세 판매자 프로필 정보 표시 수정#124
Conversation
…in profile modal (remove recent-sales)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
이 풀 리퀘스트는 경매 상세 정보(auctionDetail)에서 판매자의 소개글(bio)과 평점(rating)을 가져와 표시하도록 수정하고, 기존의 최근 판매 내역 대신 판매자 소개글을 화면에 렌더링하도록 변경합니다. 또한 관련 타입 정의를 업데이트했습니다. 리뷰에서는 displaySellerBio를 결정하는 로직을 sellerBio?.trim() || "정보없음"과 같이 간결하게 개선할 것과, displaySellerRating 렌더링 시 불필요한 중복 삼항 연산자를 제거하여 가독성을 높일 것을 제안하고 있습니다.
| const displaySellerBio = | ||
| sellerBio == null || sellerBio.trim() === "" ? "정보없음" : sellerBio; |
There was a problem hiding this comment.
삼항 연산자와 trim()을 사용한 빈 문자열 검사 로직은 ?. 연산자와 || 연산자를 활용하여 훨씬 간결하고 가독성 좋게 작성할 수 있습니다. sellerBio?.trim() || "정보없음"과 같이 작성하면 동일한 동작을 하면서도 코드가 명확해집니다.
| const displaySellerBio = | |
| sellerBio == null || sellerBio.trim() === "" ? "정보없음" : sellerBio; | |
| const displaySellerBio = sellerBio?.trim() || "정보없음"; |
References
- 가독성을 고려하여 코드를 작성해야 합니다. (link)
| {displaySellerRating === "정보없음" | ||
| ? "정보없음" | ||
| : `${displaySellerRating} (거래 ${sellerRecentSales.length}건)`} | ||
| : displaySellerRating} |
There was a problem hiding this comment.
displaySellerRating 변수는 이미 위에서 sellerRating == null ? "정보없음" : sellerRating.toFixed(1)로 정의되어 항상 문자열 값을 가집니다. 따라서 여기서 다시 한번 "정보없음" 여부를 체크하는 삼항 연산자(748~750라인)는 불필요하며, 단순히 {displaySellerRating}만 렌더링하도록 단순화하여 가독성을 높일 수 있습니다.
References
- 가독성을 고려하여 중복되거나 불필요한 로직을 단순화해야 합니다. (link)
There was a problem hiding this comment.
Pull request overview
상품 상세/경매 상세 공유 화면에서 판매자 프로필 정보 표시를 정리하는 PR입니다. 경매 응답 타입에 rating/bio를 추가하고, 평점·소개글 표시 로직을 경매·일반 양쪽에서 공통 사용하도록 수정했습니다.
Changes:
AuctionDetailSeller에 optionalrating,bio필드 추가- 평점/소개글 표시 시
auctionDetail우선, 없으면productDatafallback. 빈 문자열은정보없음 - 모달의 "상대 판매내역" 섹션 및 평점 옆 거래 건수(
(거래 N건)) 제거, "소개글" 섹션 신규 추가
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/services/auction/detail/types.ts | AuctionDetailSeller에 rating, bio 옵셔널 필드 추가 |
| src/app/products/[productId]/index.tsx | 평점/소개글 통합 로직, 거래 건수·최근 판매내역 UI 제거, 소개글 섹션 추가 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📌 Summary
상품 상세 화면의 판매자 프로필 정보 표시를 수정했습니다.
📝Description
rating,bio필드를 추가했습니다.auctionDetail.seller.rating을 우선 사용합니다.productData.seller.rating을 사용합니다.(거래 N건)문구를 제거했습니다.상대 판매내역 (최근 3건)섹션을 제거했습니다.소개글섹션을 추가했습니다.auctionDetail.seller.bio ?? productData.seller.bio기준으로 표시하며, 값이 없거나 공백이면정보없음을 표시합니다.검증:
npx tsc --noEmit통과🔗 Issue Number
close #123