Skip to content

[refactor] 좋아요/댓글 개수 전역 상태 관리 도입#193

Merged
Kim-songhui merged 3 commits intodevfrom
185-refactor
Apr 14, 2026
Merged

[refactor] 좋아요/댓글 개수 전역 상태 관리 도입#193
Kim-songhui merged 3 commits intodevfrom
185-refactor

Conversation

@Kim-songhui
Copy link
Copy Markdown
Collaborator

🔗 관련 이슈 (Issues)


📂 개요 (Summary)

좋아요/댓글 개수 전역 상태 관리 도입


💡 PR 유형 (Type)

어떤 변경 사항이 있나요?

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

🔍 작업 내용 (Details)

  1. 좋아요/댓글 개수 전역 상태 관리 도입
  • postSocialStore (Zustand) 생성: postId별 likeCount, commentCount, isLiked 관리
  • HomeScreen, activity_detail, ShokScreen, ActivityTab에서 로컬 useState → store로 전환
  • 어떤 화면에서 좋아요/댓글 변경해도 모든 화면에서 즉시 동기화
  1. CommentBottomSheet에서 store 직접 업데이트
  • 댓글 생성 시 incrementComment, 삭제 시 decrementComment 호출
  • 콜백 누락으로 인한 카운트 불일치 버그 방지
  1. API 엔드포인트 변경 반영

📷 스크린샷/영상 (UI 변경 시 필수)


‼️ 테스트 (Testing)

  • iOS에서 확인
  • Android에서 확인
  • 해당 없음 (UI/로직 영향 없음)

✅ PR Checklist

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • 커밋 메시지 컨벤션에 맞게 작성했습니다.
  • 변경 사항에 대한 테스트를 했습니다.(버그 수정/기능에 대한 테스트).

💬 리뷰 요구사항(선택)

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

@Kim-songhui Kim-songhui linked an issue Apr 13, 2026 that may be closed by this pull request
1 task
@Kim-songhui Kim-songhui self-assigned this Apr 13, 2026
@Kim-songhui Kim-songhui added the Refactor 코드 리팩토링 label Apr 13, 2026
Copy link
Copy Markdown
Collaborator

@FloriaO2 FloriaO2 left a comment

Choose a reason for hiding this comment

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

옹 toggleLike, rollbackLike 함수 따로 만들어두니까 확실히 코드 깔끔해졌네유
전역 상태 관리 넘 좋아욤 고생 많으셨습니다~!!😊

@Kim-songhui Kim-songhui merged commit 15cb155 into dev Apr 14, 2026
2 checks passed
@Kim-songhui Kim-songhui deleted the 185-refactor branch April 14, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] 좋아요 개수, 댓글 개수 전역 관리

2 participants