Skip to content

Conversation

@summerDev96
Copy link
Collaborator

@summerDev96 summerDev96 commented Aug 18, 2025

요구사항

기본

할 일 수정

  • 할 일 항목을 클릭한 후 항목 수정이 가능합니다.
  • 항목 이름을 수정할 수 있습니다.
  • 할 일 상태(진행/완료)를 수정할 수 있습니다.
  • 메모를 추가할 수 있습니다.
  • 이미지(최대 1개)를 첨부할 수 있습니다.
  • 이미지 파일 이름은 영어로만 이루어져야 합니다.
  • 파일 크기는 5MB 이하여야 합니다.
  • 수정 완료 버튼을 클릭하면 수정 사항이 반영되고, 할 일 목록 페이지로 이동합니다.

할 일 삭제

  • 삭제하기 버튼을 클릭하면 할 일 삭제가 가능하며, 삭제 후 할 일 목록 페이지로 이동합니다.

주요 변경사항

  • 상세페이지 체크 리스트, 이미지 컴포넌트, 메모 컴포넌트 추가

스크린샷

screencapture-localhost-3000-items-7454-2025-08-18-18_04_10

배포 사이트 링크

https://summerdev-sprint-mission.vercel.app/

멘토에게

  • CheckListDetail 컴포넌트에서 체크 리스트 이름 수정 시 length를 통해 길이를 맞추려고 하였는데, 더 좋은 방법이 있을까요?
  • 셀프 코드 리뷰를 통해 질문 이어가겠습니다.

@summerDev96 summerDev96 changed the base branch from main to Next-배수민 August 18, 2025 09:37
Comment on lines +62 to +76
{editMode ? (
<input
value={detailData.name}
onChange={handleNameChange}
className='focus:outline-none'
style={{ width: `${detailData.name.length + 1.4 || 1}ch` }}
onKeyDown={(e) => {
if (e.key === 'Enter') {
setEditMode(false);
}
}}
/>
) : (
<span className='truncate underline'>{detailData.name}</span>
)}
Copy link
Collaborator Author

@summerDev96 summerDev96 Aug 18, 2025

Choose a reason for hiding this comment

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

CheckListDetail 컴포넌트에서 체크 리스트 이름 수정 시 length를 통해 길이를 맞추려고 하였는데, 더 좋은 방법이 있을까요? 읽기 모드일때는 span으로 보여주고, 수정 모드일때는 input으로 보여주다보니 레이아웃이 틀어지는 것 같습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

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

고정 너비를 가진 컨테이너로 감싸서 input과 span이 동일한 공간을 차지하도록해주면 해결될것같네요! :) 너비를 고정하기 애매하다면, flex-1 min-w-0을 사용해 컨테이너가 남은 공간을 모두 차지하게 할 수 있어요.

@summerDev96 summerDev96 added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label Aug 18, 2025
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.

수고하셨습니다!
깔끔하게 잘 작성하셨네요 👍
크리티컬하게 고치거나 해야하는 피드백은 없고, 설계 위주로 리뷰 드려봤어요!

주요 리뷰 포인트

  • 본문 내 data fetching 로직 분리
  • 리액트 쿼리를 & 별도 상태 관리에 대한 피드백

Copy link
Collaborator

Choose a reason for hiding this comment

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

data fetching 로직이 길어지는데 따로 로직만 분리해 커스텀 훅을 만들어 관리해보는건 어떨까요?

},
});

const { detailData, setDetailData } = useItemStore();
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 +92 to +97
useEffect(() => {
if (data) {
const { name, memo, imageUrl, isCompleted } = data;
setDetailData({ name, memo, imageUrl, isCompleted });
}
}, [data, setDetailData]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

별도의 상태관리가 필요하지않다면 이 effect도 없앨 수 있을 것 같아요 :)


interface ItemPageProps {
params: Promise<{ itemId: string }>;
searchParams?: Promise<{ [key: string]: string | string[] | undefined }>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

id의 경우 string이 아닌 number타입으로 들어가는 경우도 있을까요?

Comment on lines +62 to +76
{editMode ? (
<input
value={detailData.name}
onChange={handleNameChange}
className='focus:outline-none'
style={{ width: `${detailData.name.length + 1.4 || 1}ch` }}
onKeyDown={(e) => {
if (e.key === 'Enter') {
setEditMode(false);
}
}}
/>
) : (
<span className='truncate underline'>{detailData.name}</span>
)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

고정 너비를 가진 컨테이너로 감싸서 input과 span이 동일한 공간을 차지하도록해주면 해결될것같네요! :) 너비를 고정하기 애매하다면, flex-1 min-w-0을 사용해 컨테이너가 남은 공간을 모두 차지하게 할 수 있어요.

@addiescode-sj
Copy link
Collaborator

질문에 대한 답변

멘토에게

  • CheckListDetail 컴포넌트에서 체크 리스트 이름 수정 시 length를 통해 길이를 맞추려고 하였는데, 더 좋은 방법이 있을까요?
  • 셀프 코드 리뷰를 통해 질문 이어가겠습니다.

본문 내에 답변 드렸습니다!

@addiescode-sj addiescode-sj merged commit c77d471 into codeit-bootcamp-frontend:Next-배수민 Sep 18, 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