Skip to content

Conversation

@Insung-Jo
Copy link
Collaborator

요구사항

sprint-misson-insung.netlify.app

기본

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

심화

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

주요 변경사항

  • 상품 등록 페이지 구현
  • 반응형 구현

스크린샷

pc
tablet
mobile

멘토에게

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

@Insung-Jo Insung-Jo requested a review from GANGYIKIM May 11, 2025 13:37
@Insung-Jo Insung-Jo self-assigned this May 11, 2025
@Insung-Jo Insung-Jo added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label May 11, 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.

인성님 6번째 미션 작업 고생하셨습니다!
가독성 좋게 잘 정리해주셔서 인성님의 의도를 잘 알 수 있는 코드였습니다.
동작상 몇가지 부분만 수정해주시면 더 좋을 것 같아요!
다음 미션도 화이팅입니다.

<p>이미지 등록</p>
<input
type="file"
accept="image/*"
Copy link
Collaborator

Choose a reason for hiding this comment

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

💊 제안
input의 accept 속성은 유저가 어떤 파일을 올려야하는지에 대한 힌트를 제공하는 속성입니다.
유저는 파일 업로드시 accept의 명시된 확장자 이외의 파일도 올릴 수 있으므로
실제 upload 함수에서 한번더 확장자를 검사해주시는 것이 좋습니다.

(사용자가 업로드창에서 옵션을 열어 확장자를 바꾸면 아래처럼 보입니다)
스크린샷 2025-05-08 오후 5 53 17

https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/accept

<>
<label>상품 이미지</label>
<div css={S.imageContainerStyle}>
<div css={S.formImageBoxStyle} 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.

💊 제안
label 태그가 더 적절합니다~

Suggested change
<div css={S.formImageBoxStyle} onClick={onClick}>
<label css={S.formImageBoxStyle}> // 클릭시 내부의 input이 선택된것과 동일함.

Comment on lines +14 to +15
<label>상품 소개</label>
<textarea
Copy link
Collaborator

Choose a reason for hiding this comment

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

💊 제안
label 태그 사용하신 것 좋아요! input과 연결도 시켜주시면 더 좋을 것 같아요.

Suggested change
<label>상품 소개</label>
<textarea
<label htmlFor="id">상품 소개</label>
<textarea
id="id"

Comment on lines +84 to +85
<FormInputs
name={name}
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
<FormInputs
name={name}
<FormInputs
name={name}

if (e.key === 'Enter') {
e.preventDefault();
const trimmed = tagInput.trim();
if (!trimmed || tags.includes(trimmed)) return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

💊 제안
중복되는 태그가 생성되지 않도록 해주신 점 좋습니다!
다만 이렇게 되면 사용자가 해당 동작에 대한 피드백을 받지 못하므로, alert, toast, input error 와 같은 방식으로 피드백을 주시면 더 좋을 것 같아요.

};

const handleTagKeyDown = (e) => {
if (e.key === 'Enter') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

❗️ 수정요청
한글로된 태그를 생성할 때 두번 입력이 발생하는 것 같은 현상이 있습니다. 이는 자모음으로 이루어진 한글을 입력중에 발생하는 현상입니다~
배포사이트에서 한글로 태그를 생성해보시고, 위의 동작을 고쳐보세요~

https://toby2009.tistory.com/53

Comment on lines +18 to +19
const isFormValid =
imagePreview &&
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 isFormValid =
imagePreview &&
const isFormValid =

@GANGYIKIM GANGYIKIM merged commit 4b8a094 into codeit-bootcamp-frontend:React-조인성 May 15, 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