Skip to content

feat : 게시글 작성자 차단하기 기능 추가#134

Merged
JioCoder merged 2 commits into
mainfrom
feat/block-user
Jun 29, 2026
Merged

feat : 게시글 작성자 차단하기 기능 추가#134
JioCoder merged 2 commits into
mainfrom
feat/block-user

Conversation

@JioCoder

Copy link
Copy Markdown
Contributor

Summary

  • 게시글 상세 화면의 더보기(⋮) 메뉴에 차단하기 버튼 추가 (신고하기 하단)
  • 차단하기 클릭 시 확인 모달 표시
  • POST /api/community/free-posts/{postId}/blocks API 연동
  • 400(자기 자신 차단 불가), 404(게시글 없음) 에러 케이스 별도 처리

Test plan

  • 타인 게시글에서 더보기(⋮) 버튼 클릭 시 신고하기 + 차단하기 메뉴 노출 확인
  • 차단하기 클릭 시 확인 모달 표시 확인
  • 모달에서 취소 클릭 시 모달 닫힘 확인
  • 모달에서 차단하기 클릭 시 API 호출 및 완료 알림 확인
  • 내 게시글에서는 차단하기 메뉴 미노출 확인 (삭제하기만 표시)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request implements the user blocking feature in the community post body. It introduces a new custom hook useBlockUser for the block API mutation, adds a confirmation modal before blocking, and handles API error responses (e.g., preventing self-blocking). The review feedback recommends several improvements: safely handling potential undefined post.id values, refactoring the useBlockUser hook to accept postId dynamically in the mutation function (and invalidating relevant queries on success), and simplifying the modal's button layout by removing redundant wrapper views and absolute positioning.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread features/community/components/post-body.tsx
Comment thread features/community/hooks/use-block-user.ts
Comment thread features/community/components/post-body.tsx
Comment on lines +363 to +401
<View
className="bg-fill-stronger"
style={{ flex: 1, height: 52, borderRadius: 10, justifyContent: "center", alignItems: "center" }}
>
<Pressable
onPress={() => setBlockModalVisible(false)}
style={({ pressed }) => ({
position: "absolute",
top: 0, left: 0, right: 0, bottom: 0,
justifyContent: "center",
alignItems: "center",
opacity: pressed ? 0.7 : 1,
})}
>
<Text className="typo-label-large text-label-subtle">
취소
</Text>
</Pressable>
</View>
<View
className="bg-status-negative-normal"
style={{ flex: 1, height: 52, borderRadius: 10, justifyContent: "center", alignItems: "center" }}
>
<Pressable
onPress={confirmBlock}
style={({ pressed }) => ({
position: "absolute",
top: 0, left: 0, right: 0, bottom: 0,
justifyContent: "center",
alignItems: "center",
opacity: pressed ? 0.7 : 1,
})}
>
<Text className="typo-label-large text-label-normal-inverse">
차단하기
</Text>
</Pressable>
</View>
</View>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

버튼을 감싸는 불필요한 View 레이어와 absolute 포지셔닝을 제거하고, Pressable 컴포넌트에 직접 스타일과 클래스를 적용하여 컴포넌트 구조를 단순화하고 가독성을 높일 수 있습니다.

              <Pressable
                onPress={() => setBlockModalVisible(false)}
                className="bg-fill-stronger"
                style={({ pressed }) => ({
                  flex: 1,
                  height: 52,
                  borderRadius: 10,
                  justifyContent: "center",
                  alignItems: "center",
                  opacity: pressed ? 0.7 : 1,
                })}
              >
                <Text className="typo-label-large text-label-subtle">
                  취소
                </Text>
              </Pressable>
              <Pressable
                onPress={confirmBlock}
                className="bg-status-negative-normal"
                style={({ pressed }) => ({
                  flex: 1,
                  height: 52,
                  borderRadius: 10,
                  justifyContent: "center",
                  alignItems: "center",
                  opacity: pressed ? 0.7 : 1,
                })}
              >
                <Text className="typo-label-large text-label-normal-inverse">
                  차단하기
                </Text>
              </Pressable>
            </View>

@JioCoder JioCoder requested a review from peisonger June 29, 2026 03:59
@JioCoder JioCoder merged commit 872cee5 into main Jun 29, 2026
2 checks passed
@JioCoder JioCoder deleted the feat/block-user branch June 29, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants