Skip to content

Conversation

@sohyun0
Copy link
Contributor

@sohyun0 sohyun0 commented Oct 10, 2025

📝 작업 개요 (필수)

  1. post 컴포넌트 스타일을 리팩토링하여 card 스타일로 분리
  2. 분리된 스타일을 응용하여 Notice 컴포넌트 제작
  3. Notice 컴포넌트는 notice / shop 타입을 받아 공고와 가게 배너를 노출하는 컴포넌트
  4. mockData 를 이용하여 테스트 및 스토리북 작성
  5. Nav 중복된 상태 삭제
  6. Button 에 cn 함수 추가
  7. 스토리북 예제 삭제

✨ 작업 내용 (필수)

  • 기능 구현
  • 버그 수정
  • 스타일/UI 변경
  • 리팩토링
  • 최적화/성능개선
  • 문서 업데이트
  • 기타 변경사항

📸 스크린샷

스크린샷 2025-10-10 오후 5 23 59 스크린샷 2025-10-10 오후 5 24 28

🧐 해결해야 하는 문제

🤔 리뷰어 확인 필요 사항

🔗 관련 이슈

🛠️ 후속 작업

  • 해당페이지 관련 리팩토링이 필요하면 추후 이어나가겠습니다.
  • [ ]

✅ 체크리스트 (필수)

  • 작업한 내용과 커밋 메시지 컨벤션을 통일했는지 확인
  • 내가 작성한 코드를 테스트까지 완료했는지 잘 작동했는지 확인
  • ESLint 검사 통과
  • Prettier 포맷팅 적용
  • TypeScript 에러 없음
  • 빌드 에러 없음

@sohyun0 sohyun0 self-assigned this Oct 10, 2025
@sohyun0 sohyun0 added ✨ feat 새로운 기능 추가 ♻️ refactor 결과 변화 없이 코드 구조 개선 🔧 chore 그 외 기타 수정 (빌드 스크립트 수정, 패키지 관리, 파일 삭제/이름 변경 등) labels Oct 10, 2025
@vercel
Copy link

vercel bot commented Oct 10, 2025

@sohyun0 is attempting to deploy a commit to the projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Oct 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
thejulge Ready Ready Preview Comment Oct 11, 2025 7:13am

Comment on lines +56 to +65
<Button
as={Link}
href={href}
size='xs38'
full
className='font-bold'
variant={status !== 'open' ? 'disabled' : 'primary'}
>
{status !== 'open' ? '신청 불가' : '신청하기'}
</Button>
Copy link
Contributor

Choose a reason for hiding this comment

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

조건문을 변수로 사용하는 건 어떨까요? (제안)

const isOpen = status === 'open';
const statusText = isOpen ? '신청하기' : '신청 불가';
const statusVariant = isOpen ? 'primary' : 'disabled'; 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

아 이부분은 실제로 사용하는건 아니고 사용법을 보여드리기위한 목업컴포넌트라 추후 삭제할 예정입니다 :D

Comment on lines 52 to 73
{variant === 'notice' && (
<>
<NoticeHeader name={name} category={category} />
<section className={noticeFrame()}>
<NoticeImage name={name} imageUrl={imageUrl} />
<NoticeInfo variant={variant} value={noticeVariantValue} buttonComponent={children} />
</section>
<section className='flex flex-col gap-3 rounded-xl bg-gray-100 p-8'>
<h3 className='text-body-l font-bold'>공고 설명</h3>
<p className='text-body-l'>{description}</p>
</section>
</>
)}
{variant === 'shop' && (
<>
<h2 className={cardLayout.heading({ size: 'lg' })}>내 가게</h2>
<section className={cn(noticeFrame(), 'bg-red-100')}>
<NoticeImage name={name} imageUrl={imageUrl} />
<NoticeInfo variant={variant} value={shopVariantValue} buttonComponent={children} />
</section>
</>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

JSX 내부보다 함수로 변경해 외부에서 사용하는 건 어떨까요?

ex) {variant === 'notice' ? renderNotice() : renderShop()}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renderNotice , renderShop 파일로 분리했습니다!
컴포넌트 분리하면서 해당 컴포넌트가 3depth 까지 전파되고 있는데 props drilling 도 문제였는데 타입도 똑같이 drilling 되더라구요 ㅠ 이런점을 나중에좀 생각하면서 리팩토링 해야겠다는 생각 했습니다 ㅎㅎ

Copy link
Contributor

Choose a reason for hiding this comment

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

고생하셨습니다! 저도 컴포넌트 분리하거나 리팩토링 할 때 depth 깊어지는 경우가 많더라구요😭
리팩토링도 여러가지 고려해야 하는 부분이 많은 것 같습니다...

@sohyun0 sohyun0 merged commit 6e54c0a into codeit-FE18-part3:develop Oct 11, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 chore 그 외 기타 수정 (빌드 스크립트 수정, 패키지 관리, 파일 삭제/이름 변경 등) ✨ feat 새로운 기능 추가 ♻️ refactor 결과 변화 없이 코드 구조 개선

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] post 컴포넌트 리팩토링 및 내 가게 UI 컴포넌트 구현

2 participants