Skip to content

Conversation

@CJewon
Copy link
Collaborator

@CJewon CJewon commented Dec 9, 2024

요구사항

기본

  • 각 상품 클릭 시 상품 상세 페이지로 이동합니다.
  • 상품 상세 페이지 주소는 “/items/{productId}” 입니다.
  • 목록으로 돌아가기 버튼을 클릭하면 중고마켓 페이지 주소인 “/items” 으로 이동합니다
  • 문의하기에 내용을 입력하면 등록 버튼의 색상은 “3692FF”로 변합니다.

심화

  • [x]
  • []

주요 변경사항

스크린샷

화면 캡처 2024-12-09 124815
화면 캡처 2024-12-09 124938

멘토에게

  • 반응형 웹은 만들지 못하였습니다.

  • 위 스크린샷 두 장을 비교해보면 유저에 관한 위치가 다릅니다. 아이패드가 요구사항의 디자인 시안입니다. html 구조를 만들때 잘못 만든건지, 아니면 css로 구현을 하지 못한건지 모르겠지만, 만들다가 막혀서 질문드립니다. 처음에 space-between으로 속성을 주웠는데, 이후 다른 div태그들의 간격을 변경하려고 하니 space-between 속성에 묻혀 변경되지 않아 다른 방법으로 하려고 햇으나, 찾지 못하엿습니다. ㅠㅠ 간단하게라도 설명해주시면 이후 찾아서 만들어보겠습니다 !! 감사합니다 !!

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

@CJewon CJewon requested a review from kich555 December 9, 2024 15:42
@CJewon CJewon added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label Dec 9, 2024
Copy link
Collaborator

@kich555 kich555 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 ㅎ

Comment on lines +31 to +32
console.error("Failed to fetch product by ID:", error);
throw error;
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍👍

import { ReactComponent as CloseIcon } from "../../assets/images/icons/ic_x.svg";

const Button = styled.button`
background-color: ${({ theme }) => theme.colors.gray[0]};
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍👍👍


function DeleteButton({ onClick, label }) {
return (
<Button aria-label={`${label} 삭제`} onClick={onClick}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Type도 명시되면 더 좋겠네요 ㅎ

Comment on lines +20 to +29
const fetchProduct = async () => {
try {
const data = await getProductsById(productId);
setProduct(data);
} catch (error) {
console.error("Failed to fetch product details:", error);
} finally {
setLoading(false);
}
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

getProductsById에서 이미 try catch하고 logging처리까지 하고있지 않나요? 그러면 여기의 catch구문에서는

setError 와 같이 UI에 영향이 갈 리액트의 에러상태를 컨트롤하는게 맞아보여요 다시 로그를 찍는것보단 ㅎ

@kich555 kich555 merged commit d95cacb into codeit-bootcamp-frontend:React-최제원 Dec 16, 2024
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