feat : 게시글 작성자 차단하기 기능 추가#134
Conversation
There was a problem hiding this comment.
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.
| <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> |
There was a problem hiding this comment.
버튼을 감싸는 불필요한 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>
e848fd6 to
153b855
Compare
Summary
Test plan