Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] 댓글 기능 구현 #93

Merged
merged 10 commits into from
Nov 28, 2023
Merged

[FEAT] 댓글 기능 구현 #93

merged 10 commits into from
Nov 28, 2023

Conversation

seongminn
Copy link
Member

@seongminn seongminn commented Nov 27, 2023

🌍 이슈 번호

✅ 작업 내용

  • 댓글 조회 기능 구현
    • 과거 댓글은 useSuspenseInfiniteQuery를 통해 무한 스크롤로 구현했습니다.
    • 새로 추가되는 댓글은 @stomp/stompjs 라이브러리를 통해 STOMP로 구현했습니다.
    • stomp는 웹 소켓 위에서 동작하는 Simple Text Oriented Messaging Protocol으로 메시지를 보내는 발행자, 메시지를 전달 받는 수신자가 존재합니다. 그리고 메시지 브로커가 발신자가 보낸 메시지를 수신자에게 전달하는 pub/sub 구조로 이루어져 있습니다.
    • stomp의 메시지는 http와 비슷하게 header, body, command로 이루어져 있고, 구조가 일관되기 때문에 통신에 용이합니다.
  • 시간에 쫓겨 댓글 관련 컴포넌트의 구조가 맘에 들지 않는데, 추후 리팩토링 하면 좋을 것 같네요.
  • 신고 기능 추가
  • 시간을 가독성 있게 띄워줄 수 있도록 utc time을 local time으로 변경하는 유틸 함수를 추가했습니다.

♾️ 기타

  • 메인에 반영 후 yarn add로 의존성 설치를 해주셔야 합니다.
  • 신고가 완료되었음을 알려주는 토스트 메시지를 띄워주면 좋을 것 같습니다.

@seongminn seongminn added the FEAT 새로운 기능 추가 label Nov 27, 2023
@seongminn seongminn requested a review from HiimKwak November 27, 2023 19:35
@seongminn seongminn self-assigned this Nov 27, 2023
Copy link
Contributor

@HiimKwak HiimKwak left a comment

Choose a reason for hiding this comment

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

고생하셨습니다. useMutation을 따로 분리할 생각을 못했는데 성민님 코드 보고 useMutation도 분리해놔야겠네요. 시간 파싱하는 함수도 충돌이 일어날 것 같아서 이 PR이 메인에 머지된 후에 충돌 잡고 PR 올리겠습니다!


import useMatchCommentById from './query';

type MatchCommentFetcher = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Props 접미사가 빠진 것 같습니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

추가로 이 PR 작업 영역은 아니나 useMatchById query.ts 파일 내 쿼리키 값에 오타가 하나 있습니다(MATCH_DETAL)!

Copy link
Member Author

Choose a reason for hiding this comment

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

오 반영하겠습니다!
오타는 나중에 queryKey를 일괄적으로 관리할 계획이라서 그 때 수정하겠습니다!

@seongminn seongminn merged commit e353306 into main Nov 28, 2023
@seongminn seongminn deleted the feat/comment branch November 28, 2023 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FEAT 새로운 기능 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants