[#54] 아이템 상세 페이지 디자인 수정 !#85
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR applies design updates and feature enhancements to the item detail page, including layout adjustments, interactive buttons, and utility additions.
- Refactored API hook imports and propagated new props (itemId, isMine, isLiked) through DetailPage to child components
- Added like/delete functionality, relative-time display, and dynamic price/token rendering in detail components
- Updated CSS using cva, replaced custom VerifiedTag with SchoolVerifiedTag, and introduced new utility functions
Reviewed Changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/DetailPage/index.tsx | Updated hook import path; passed itemId, isMine, isLiked |
| src/features/home/components/RecentList/index.tsx | Updated hook import path |
| src/features/detail/components/UserInfo/style.css.ts | Migrated LikeButton to cva; removed VerifiedTag CSS |
| src/features/detail/components/UserInfo/index.tsx | Replaced inline VerifiedTag with SchoolVerifiedTag; implemented like button logic |
| src/features/detail/components/PostContent/style.css.ts | Added lineClamp, flex layout for price, and white-space handling |
| src/features/detail/components/PostContent/index.tsx | Rendered rental/sale prices conditionally; integrated relative-time and ItemTokenList |
| src/features/detail/components/DetailHeader/index.tsx | Added useDeleteItem hook and conditional delete button for owner |
| src/features/detail/apis/usePostLike.ts | New mutation hook for liking items |
| src/features/detail/apis/useDeleteItem.ts | New mutation hook for deleting items |
| src/common/utils/toKST.ts | New utility converting UTC dates to KST |
| src/common/utils/getKoreanRelativeTime.ts | New utility for Korean relative time display |
| src/common/components/SchoolVerifiedTag/style.css.ts | New CSS for the school-verified tag |
| src/common/components/SchoolVerifiedTag/index.tsx | New component for school-verified tag |
| src/common/components/ItemTokenList/index.tsx | New component aggregating item tokens |
Comments suppressed due to low confidence (2)
src/common/utils/getKoreanRelativeTime.ts:5
- [nitpick] The parameter
ais ambiguous. Rename it todateortimestampto improve readability and clarity.
export const getKoreanRelativeTime = (a: Date) => {
src/common/utils/getKoreanRelativeTime.ts:1
- This new relative time utility lacks accompanying tests. Consider adding unit tests covering boundary cases (seconds, minutes, hours, etc.) to ensure correctness.
/**
| )} | ||
| </div> | ||
| )} | ||
| {isSale && ( |
There was a problem hiding this comment.
The sale price block is rendered twice when both isRental and isSale are true—once inside the rental wrapper and once afterwards. Consider removing the nested sale conditional or merging both into a single conditional block.
vsc 키기 귀찮아 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
vsc키기귀찮아 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
마지막 커밋 메세지가 왜 저러지 졸면서 썼나 |
|
그니까 보고 놀랐어 |
| }, | ||
| }); | ||
| }; | ||
|
|
There was a problem hiding this comment.
아 그냥 바로 지워지는 거였구나 먼가 했네
| fontWeight: 600, | ||
| lineHeight: 1.4, | ||
| letterSpacing: '-0.045rem', | ||
| lineClamp: 2, |
There was a problem hiding this comment.
흠 이거 post에서 글자수 제한 받아야겠지
There was a problem hiding this comment.
아마 필요할꺼 같음
기본 길이제한이 서버쪽에도 있더라
근데 노션에 정리해둔 길이제한으로 프론트에서도 한번 막아주는 게 좋을듯
|
머지!머지!머지! |
❗ 연관 이슈
📌 내용
기본 상세 페이지 화면
좋아요 누르기
그외 짜잘한 수정
이제 줄바꿈이 잘 표시됨
아직 바뀐 디자인은 적용 안함 (공용 컴포넌트라 충돌 있을거 같아서 얘는 브랜치 따로 팔게연)다행히 취소됐다고 함하는 김에
/hooks/apis에 있던 api 관련 훅들 그냥/apis로 옮겼어요/hooks에는 진짜 훅들만 저장할라꼬☑️ 체크 사항 & 논의 사항