Skip to content

Conversation

@TopiaYu
Copy link
Collaborator

@TopiaYu TopiaYu commented May 12, 2025

https://scintillating-ganache-14d305.netlify.app/Items

요구사항

기본

상품 상세

  • 상품 상세 페이지 주소는 "/items/{productId}" 입니다.
  • response 로 받은 아래의 데이터로 화면을 구현합니다.
  • => favoriteCount : 하트 개수
  • => images : 상품 이미지
  • => tags : 상품태그
  • => name : 상품 이름
  • => description : 상품 설명

상품 문의 댓글

  • 문의하기에 내용을 입력하면 등록 버튼의 색상은 "3692FF"로 변합니다.
  • response 로 받은 아래의 데이터로 화면을 구현합니다
  • => image : 작성자 이미지
  • => nickname : 작성자 닉네임
  • => content : 작성자가 남긴 문구
  • => description : 상품 설명
  • => updatedAt : 문의글 마지막 업데이트 시간
  • 목록으로 돌아가기 버튼을 클릭하면 중고마켓 페이지 주소인 "/items" 으로 이동합니다

심화

  • 모든 버튼에 자유롭게 Hover효과를 적용하세요.

주요 변경사항

  • 상세페이지 기능구현
  • 상세페이지 ui 구현
  • 목록으로 돌아가기 기능 구현
  • api를 통해 상세정보, 코멘트 구현

스크린샷

데스크탑 Screenshot 2025-05-12 at 5 47 40 pm
모바일 Screenshot 2025-05-12 at 5 48 34 pm

멘토에게

  • 셀프 코드 리뷰를 통해 질문 이어가겠습니다.

@TopiaYu TopiaYu requested a review from GANGYIKIM May 12, 2025 08:51
@TopiaYu TopiaYu self-assigned this May 12, 2025
@TopiaYu TopiaYu added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label May 12, 2025
Copy link
Collaborator

@GANGYIKIM GANGYIKIM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

동환님 7번째 미션 수고하셨습니다!
필요한 로직들만 잘 구현하셨습니다.
로그인 구현 이후 코멘트 생성, 수정, 삭제 로직도 추가해보시면 좋겠습니다.
다음 미션도 화이팅입니다!

Comment on lines +35 to +36
<Link to={`/Items/${item.id}`} css={itemLinkStyle} >
<ItemList key={item.id} item={item} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗️ 수정요청

Suggested change
<Link to={`/Items/${item.id}`} css={itemLinkStyle} >
<ItemList key={item.id} item={item} />
<Link key={item.id} to={`/Items/${item.id}`} css={itemLinkStyle} >
<ItemList item={item} />

Comment on lines +24 to +25
<Link to={`${item.id}`} css={linkStyle}>
<ItemList key={item.id} item={item}/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗️ 수정요청

Suggested change
<Link to={`${item.id}`} css={linkStyle}>
<ItemList key={item.id} item={item}/>
<Link key={item.id} to={`${item.id}`} css={linkStyle}>
<ItemList item={item}/>

Comment on lines +27 to +29
@media(max-width: 425px) {
flex-direction: column;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗️ 수정요청

Suggested change
@media(max-width: 425px) {
flex-direction: column;
}
@media(max-width: 425px) {
flex-direction: column;
}

Comment on lines +167 to +168
const likeSection = css `
// display: inline-flex;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗️ 수정요청
사용하지 않는 코드는 지워주세요~

Suggested change
const likeSection = css `
// display: inline-flex;
const likeSection = css `

<h3>{item.name}</h3>
<img src={kebabIcon} css={editIconStyle} />
</div>
<h2>{item.price}</h2>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💊 제안
금액의 경우 (,)를 통해 단위가 구분되도록 아래처럼 작성해주세요!

Suggested change
<h2>{item.price}</h2>
<h2>{item.price.toLocaleString()}</h2>

<p>{new Date(item.createdAt).toISOString().slice(0, 10)}</p>
</div>
<div css={likeSection}>
<button>💛</button>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💊 제안
노란 하트 이모지가 귀엽네요. 다만 디자인과 다르니 확인해보시고 디자인대로 수정하시면 좋겠습니다!

</div>
<div css={userText}>
<h4>{item.ownerNickname}</h4>
<p>{new Date(item.createdAt).toISOString().slice(0, 10)}</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💊 제안
날짜를 formatting하는 로직들은 일반적으로 재사용되는 경우가 많으니 util로 분리하시면 좋을 것 같아요.

value={commentTextarea}
onChange={handleChange}
/>
<button type="button" css={[commentButtonStyle, isButtonActive && activeButtonStyle]} >등록</button>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗️ 수정요청
지금의 경우 스타일만 disabled처럼 보이게 적용이 된 것이고 실제로는 클릭이 가능하게 처리되어 있습니다.
불필요한 렌더링을 줄이기 위해 commentButtonStyle 내부에 :disabled 가상 클래스로 스타일링해주세요~

Suggested change
<button type="button" css={[commentButtonStyle, isButtonActive && activeButtonStyle]} >등록</button>
<button type="button" disabled={isButtonActive} css={commentButtonStyle}>등록</button>

Comment on lines +403 to +408
<Link to={"/items"} css={linkStyle}>
<button type='button' css={backToListButtonStyle} >
<p>목록으로 돌아가기</p>
<img src={backIcon} />
</button>
</Link>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💊 제안
단순 페이지 이동이니 Link 태그를 사용하시는 것이 더 적절해보입니다.
디자인이 버튼처럼 보이신다고 꼭 버튼 태그를 사용하실 필요는 없습니다. Link 태그에 css로 디자인대로 스타일링해주세요~

Suggested change
<Link to={"/items"} css={linkStyle}>
<button type='button' css={backToListButtonStyle} >
<p>목록으로 돌아가기</p>
<img src={backIcon} />
</button>
</Link>
<Link to={"/items"} css={[linkStyle,backToListButtonStyle]}>
<p>목록으로 돌아가기</p>
<img src={backIcon} />
</Link>

return body
}

export async function getProductComments(productId, limit=10) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗️ 수정요청
지금은 고정값으로 코멘트를 불러오고 있어요~
모든 코멘트가 보이도록 무한스크롤 방식으로 구현해주시면 좋겠습니다!

@GANGYIKIM GANGYIKIM merged commit b0fdebd into codeit-bootcamp-frontend:React-유동환 May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants