Skip to content

Conversation

@DreamPaste
Copy link
Collaborator

요구사항

기본

  • 상품 등록 페이지 주소는 "/additem"입니다.
  • [x]페이지 주소가 “/additem” 일때 상단네비게이션바의 '중고마켓' 버튼의 색상은 “3692FF”입니다.
    상품 이미지는 최대 한개 업로드가 가능합니다.
  • [x]각 input의 placeholder 값을 정확히 입력해주세요.
    -[x]이미지를 제외하고 input 에 모든 값을 입력하면 ‘등록' 버튼이 활성화 됩니다.

심화

  • [x]이미지 안의 X 버튼을 누르면 이미지가 삭제됩니다.
  • [x]추가된 태그 안의 X 버튼을 누르면 해당 태그는 삭제됩니다.

주요 변경사항

스크린샷

@addiescode-sj addiescode-sj self-requested a review June 2, 2025 07:21
Copy link
Collaborator

@addiescode-sj addiescode-sj left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

주요 리뷰 포인트

  • 복잡도 감소를 위한 컴포넌트 분리
  • 예외 케이스 처리하기

// todo: /additem 으로 이동
// /additem 으로 이동
navigate('/additem');
console.log('상품 추가 버튼 클릭');
Copy link
Collaborator

Choose a reason for hiding this comment

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

불필요한 로그는 PR 올리실때 지워봅시다! :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

BEM 방식으로 잘 nesting 되어있네요. 굳굳 👍

Comment on lines +55 to +56
};
const removeTag = (t: string) =>
Copy link
Collaborator

Choose a reason for hiding this comment

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

55, 56 사이 공백 한칸 띄워줄까요? 함수와 함수 사이엔 공백 한칸씩 꼭 띄우도록합시다 :)

const value = tagInput.trim();
if (!value || tags.includes(value)) return;

setTags((prev) => [...prev, value]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

spread 연산자를 사용해 배열을 복사 후 새 아이템을 추가하는군요!
Array또한 레퍼런스 타입이라 array.push로 직접적으로 변경하지않고 지금과 같이 원본 배열을 변경하지않는 방식이 좋습니다 :)

이 과정에서 배열을 다룰때 발생할 수 있는 예외 케이스 (예를 들어, 중복값을 허용할것인지 등) 를 꼼꼼하게 더 처리해볼까요?

Comment on lines +59 to +61
const handleSubmit = () => {
console.log({ images, name, description, price: Number(price), tags });
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

해당 함수는 실제 제출을 담당하지는 않고 로그만 찍는 용도인가요? :)

Comment on lines +110 to +115
<input
className={style['product-add-page__input']}
placeholder="상품명을 입력해주세요"
value={name}
onChange={(e) => setName(e.target.value)}
/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

ProductAddPage의 복잡도를 감소시키기위해,
폼 컨트롤 + 업데이트 로직을 다른 컴포넌트 단위로 분리해보는건 어떨까요?
Form, FormInput 두개의 컴포넌트를 사용해 리팩토링해봐요!

@addiescode-sj addiescode-sj merged commit 00b4e43 into codeit-bootcamp-frontend:React-염휘건 Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants