Conversation
- 토큰 너무 많으면 +로 표시해주기 - 대여료, 보증금, 판매가 알잘딱 표시 - interaction area랑 token 개수 area랑 위치 변경
There was a problem hiding this comment.
Pull Request Overview
This PR updates the home screen design to match new design specifications, including layout adjustments, price display improvements, and better handling of long content and multiple tags.
- Modified ItemCard layout with new dimensions and spacing
- Updated price display to show rental/sale information in a vertical layout with styled labels
- Reordered footer elements and added overflow handling for tokens with a "+N" indicator for excess items
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/libs/constants/index.ts | Adds MAX_PRICE constant for price validation |
| src/features/home/components/ItemCard/style.css.ts | Updates styling with new dimensions, layout changes, and overflow handling |
| src/features/home/components/ItemCard/index.tsx | Refactors price display logic and footer element ordering |
| src/common/components/Token/style.css.ts | Adds flexShrink: 0 to prevent token shrinking |
| src/common/components/ItemTokenList/index.tsx | Adds showAll prop and "+N" overflow indicator functionality |
| @@ -0,0 +1 @@ | |||
| export const MAX_PRICE = 999999; | |||
There was a problem hiding this comment.
The magic number 999999 should be documented with a comment explaining its purpose and why this specific value was chosen.
|
좋아요 근데 난 토큰이랑 interaction이랑 위치 그대로인 게 더 마음에 드는데... 디멘 해야겠죠 걍 |
|
앞태그가 더 자연스러운 것 같어 |
…ority to size n quality tokens
✅ Deploy Preview for repicka ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[netlify] 얘는 또 뭐야? |
|
@jw0202058 우리의 데브 배포를 담당해줄 새로운 친구 |
| ))} | ||
| {showTags.map(type => { | ||
| // 기타는 표시 X | ||
| if (type === 'COLOR_OTHER' || type === 'PRODUCT_OTHER') return null; |
| {isRental && ( | ||
| <div className={s.PriceItem}> | ||
| <label>대여</label> | ||
| <p>{data.rentalFee.toLocaleString()}원</p> | ||
| <p> | ||
| <label>보증금</label> | ||
| {data.deposit.toLocaleString()}원 | ||
| </p> | ||
| </div> | ||
| )} | ||
| {isSale && ( | ||
| <div className={s.PriceItem}> | ||
| <label>판매</label> | ||
| <p>{data.salePrice.toLocaleString()}원</p> | ||
| </div> | ||
| )} |
There was a problem hiding this comment.
이 부분 컴포넌트 따로 빼서 쓰면 더 깔끔하지 안ㅎ을까 하는 생각을 하는데 ㅓㅇ떻게 생각하시나요
| ...(itemInfo.size ? [itemInfo.size] : []), | ||
| ...(itemInfo.quality ? [itemInfo.quality] : []), | ||
| ...(itemInfo.color ? [itemInfo.color] : []), | ||
| ...(itemInfo.tradeMethods || []), |
There was a problem hiding this comment.
여기 코드 겁나 궁금하다 설명해주면 좋겟다
There was a problem hiding this comment.
... < 배열 풀어헤치는 js 문법
그래서 그냥 itemInfo가 가지고 있는 속성들이 다 각자 배열로 되어있는데 얘를 뜯어서 tags라는 배열에 탈탈 털어넣는 로직임
Props에서 옵셔널로 itemInfo 속성을 받고 있어서 각 속성이 undefined일 수도 있음
transactionTypes, productTypes, tradeMethods 이런 애들은 배열이어서 만약에 undefined면 ...[] 요렇게 해서 빈배열을 언박싱하는 식으로 사용 가능함 (tags에 아무것도 안들어감)
근데 문제는 color, quality, size는 단일 타입이어서 undeifined일때 기존처럼 써버리면 그냥 tags 배열에 undefined가 들어가버리게 됨
그러면 이제 아래 tsx 코드에서 type에 undefined가 들어가게 돼서 서비스 멸망..
그래서 위에 배열 타입들이랑 똑같이 쓰기 위해서
...(itemInfo.size ? [itemInfo.size] : []) 요런식으로 써서 size 값이 있으면 size를 한번 포장한 애를 언박싱해서 tags에 넣도록 동작하고,
undefined면 그냥 빈 상자를 언박싱해서 tags에 넣도록 동작하게 했삼
뭔말알?
There was a problem hiding this comment.
나아는사람강다니엘닮은이모급 설명이었는데 이해한거 맞아요?
| <p>{data.deposit.toLocaleString()}원</p> | ||
| </div> | ||
| {isRental && <PriceToken price={data.rentalFee} deposit={data.deposit} />} | ||
| {isSale && <PriceToken price={data.salePrice} />} |


❗ 연관 이슈
📌 내용
☑️ 체크 사항 & 논의 사항