fix(community): 리스트 잠금 반응 표시를 숨긴다

This commit is contained in:
2026-07-12 09:54:10 +09:00
parent ced226c3ef
commit 9da6c7381d
5 changed files with 24 additions and 2 deletions

View File

@@ -35,7 +35,8 @@ private fun CreatorChannelCommunityPostResponse.toCommunityPostUiModel(
existOrdered = existOrdered, existOrdered = existOrdered,
likeCount = likeCount, likeCount = likeCount,
commentCount = commentCount, commentCount = commentCount,
showComment = isCommentAvailable, showReaction = !isLocked,
showComment = isCommentAvailable && !isLocked,
showNotice = isPinned, showNotice = isPinned,
isPinned = isPinned, isPinned = isPinned,
isLocked = isLocked, isLocked = isLocked,

View File

@@ -37,6 +37,7 @@ data class CreatorChannelCommunityPostUiModel(
val existOrdered: Boolean, val existOrdered: Boolean,
val likeCount: Int, val likeCount: Int,
val commentCount: Int, val commentCount: Int,
val showReaction: Boolean,
val showComment: Boolean, val showComment: Boolean,
val showNotice: Boolean, val showNotice: Boolean,
val isPinned: Boolean, val isPinned: Boolean,

View File

@@ -65,10 +65,13 @@ class CreatorChannelCommunityListAdapter(
tvCreatorChannelCommunityListTime.text = item.createdAtText tvCreatorChannelCommunityListTime.text = item.createdAtText
layoutCreatorChannelCommunityListNotice.isVisible = item.showNotice layoutCreatorChannelCommunityListNotice.isVisible = item.showNotice
tvCreatorChannelCommunityListBody.text = item.content tvCreatorChannelCommunityListBody.text = item.content
layoutCreatorChannelCommunityListReaction.isVisible = item.showReaction || item.showComment
tvCreatorChannelCommunityListCommentCount.text = item.commentCount.moneyFormat() tvCreatorChannelCommunityListCommentCount.text = item.commentCount.moneyFormat()
tvCreatorChannelCommunityListCommentCount.isVisible = item.showComment tvCreatorChannelCommunityListCommentCount.isVisible = item.showComment
ivCreatorChannelCommunityListComment.isVisible = item.showComment ivCreatorChannelCommunityListComment.isVisible = item.showComment
tvCreatorChannelCommunityListLikeCount.text = item.likeCount.moneyFormat() tvCreatorChannelCommunityListLikeCount.text = item.likeCount.moneyFormat()
tvCreatorChannelCommunityListLikeCount.isVisible = item.showReaction
ivCreatorChannelCommunityListLike.isVisible = item.showReaction
val visibleImageUrl = item.imageUrl.takeUnless { item.isLocked } val visibleImageUrl = item.imageUrl.takeUnless { item.isLocked }
layoutCreatorChannelCommunityListImageContainer.isVisible = layoutCreatorChannelCommunityListImageContainer.isVisible =

View File

@@ -216,6 +216,7 @@
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout
android:id="@+id/layout_creator_channel_community_list_reaction"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginTop="@dimen/spacing_16" android:layout_marginTop="@dimen/spacing_16"
@@ -235,14 +236,15 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_4" android:layout_marginStart="@dimen/spacing_4"
android:layout_marginEnd="15dp"
android:includeFontPadding="false" android:includeFontPadding="false"
android:textColor="@color/gray_400" android:textColor="@color/gray_400"
tools:text="5" /> tools:text="5" />
<ImageView <ImageView
android:id="@+id/iv_creator_channel_community_list_like"
android:layout_width="18dp" android:layout_width="18dp"
android:layout_height="18dp" android:layout_height="18dp"
android:layout_marginStart="15dp"
android:contentDescription="@null" android:contentDescription="@null"
android:src="@drawable/ic_feed_community_heart" /> android:src="@drawable/ic_feed_community_heart" />

View File

@@ -77,6 +77,21 @@ class CreatorChannelCommunityMapperTest {
assertFalse(item.showPlayButton) assertFalse(item.showPlayButton)
} }
@Test
fun `유료 미구매 타인 게시글은 reaction 현황과 댓글을 숨긴다`() {
val item = listOf(
communityPost(
price = 100,
existOrdered = false,
isCommentAvailable = true
)
).toCommunityPostUiModels(relativeTimeTextFormatter, isOwner = false, currentUserId = 99L).single()
assertTrue(item.isLocked)
assertFalse(item.showReaction)
assertFalse(item.showComment)
}
@Test @Test
fun `고정 게시글 여부는 owner more 정책에서 사용할 수 있도록 UI 모델에 보존한다`() { fun `고정 게시글 여부는 owner more 정책에서 사용할 수 있도록 UI 모델에 보존한다`() {
val pinnedItem = listOf(communityPost(isPinned = true)) val pinnedItem = listOf(communityPost(isPinned = true))