Skip to content

Conversation

@kss761036
Copy link
Owner

@kss761036 kss761036 commented Apr 7, 2025

❓이슈

📝 Description

Comment 컴포넌트 리팩토링

<Comment
  {...comment}
  linkToEpigram={true}
  baseUrl='/epigrams/'
  isOwnComment={isOwnComment}
  handleEdit={() => isOwnComment && handleEdit(comment)}
  handleDelete={() => isOwnComment && handleDeleteConfirm(comment.id)}
/>
  • linkToEpigram가 true면 <Link>, false면 <div>로 렌더링되도록 수정
  • baseUrl에 id값 제외하고 이동할 url 작성
  • id값은 Comment컴포넌트에서 직접 추가해줌

🌀 PR Type

어떤 변경 사항이 있나요?

  • 새로운 기능 추가
  • 버그 수정
  • CSS 등 사용자 UI 디자인 변경
  • 코드에 영향을 주지 않는 변경사항 (오타 수정, 탭 사이즈 변경, 변수명 변경)
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 테스트 추가, 테스트 리팩토링
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제

PR

  • Branch Convention 확인

    feat/* 기능 구현, fix/* 버그 수정, refactor/* 개선

  • Base Branch 확인
  • 적절한 Label 지정
  • Assignee 및 Reviewer 지정

@kss761036 kss761036 added Priority: Medium 🔖 우선순위 보통 Type: Refactor ♻️ 리팩토링 labels Apr 7, 2025
@kss761036 kss761036 requested a review from cksrlcks April 7, 2025 13:13
@kss761036 kss761036 self-assigned this Apr 7, 2025
@kss761036 kss761036 linked an issue Apr 7, 2025 that may be closed by this pull request
1 task
@vercel
Copy link

vercel bot commented Apr 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
epigram-gilv ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2025 5:41am

@github-actions
Copy link

github-actions bot commented Apr 7, 2025

import type { FieldErrors } from 'react-hook-form';

interface CommentListProps {
href?: string;
Copy link
Collaborator

@cksrlcks cksrlcks Apr 8, 2025

Choose a reason for hiding this comment

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

그냥 링크가 가능한 컴포넌트임을 나타내려는 프롭이면 boolean 타입으로 linkable 등으로 받아도 될 것같구요,
아니면 직접 주소를 전달하는 방식도 괜찮은것 같아요.

지금 저희 서비스에서는 코멘트가 한 게시판에 묶여있는거지만, 여러 게시판이 있는경우고, 코멘트 컴포넌트가 공용으로 쓰인다고 했을때에는 이 부분이 수정되어야할 것 같아서욤

예를 들어서 board/{id}, epigram/{id}, market/{id} 이렇게 여러 게시판에서 코멘트가 쓰인다고 생각하면, 지금의 코멘트 컴포넌트는 epgiram으로만 이동되겠죠?

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 102 to 110
{href ? (
<Link href={href + epigramId} className={classes.commentWrapper}>
<CommentBody />
</Link>
) : (
<div className={classes.commentWrapper}>
<CommentBody />
</div>
)}
Copy link
Collaborator

@cksrlcks cksrlcks Apr 8, 2025

Choose a reason for hiding this comment

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

body부분 묶어내서, 관리하기 편할것같아요 👍

@github-actions
Copy link

github-actions bot commented Apr 8, 2025

Copy link
Collaborator

@cksrlcks cksrlcks left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

@kss761036 kss761036 merged commit c730c49 into main Apr 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Medium 🔖 우선순위 보통 Type: Refactor ♻️ 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Comment 컴포넌트 prop 추가 리팩토링

3 participants