fix(community): 상세 잠금 반응과 댓글을 숨긴다
This commit is contained in:
+3
@@ -140,12 +140,15 @@ class CreatorChannelCommunityDetailActivity : BaseActivity<ActivityCreatorChanne
|
||||
tvCreatorChannelCommunityDetailNickname.text = post.creatorNickname
|
||||
tvCreatorChannelCommunityDetailTime.text = post.createdAtText
|
||||
tvCreatorChannelCommunityDetailBody.text = post.content
|
||||
layoutCreatorChannelCommunityDetailReaction.isVisible = post.showReaction || content.isCommentAvailable
|
||||
tvCreatorChannelCommunityDetailLikeCount.text = post.likeCount.moneyFormat()
|
||||
tvCreatorChannelCommunityDetailCommentCount.text = post.commentCount.moneyFormat()
|
||||
tvCreatorChannelCommunityDetailCommentHeader.text = getString(
|
||||
R.string.creator_channel_community_comment_header,
|
||||
post.commentCount.moneyFormat()
|
||||
)
|
||||
ivCreatorChannelCommunityDetailHeart.isVisible = post.showReaction
|
||||
tvCreatorChannelCommunityDetailLikeCount.isVisible = post.showReaction
|
||||
ivCreatorChannelCommunityDetailHeart.setImageResource(
|
||||
if (post.isLiked) R.drawable.ic_feed_community_heart_fill else R.drawable.ic_feed_community_heart
|
||||
)
|
||||
|
||||
+11
-7
@@ -304,18 +304,20 @@ class CreatorChannelCommunityDetailViewModel(
|
||||
}
|
||||
|
||||
val isCreatorOwner = data.creatorId == SharedPreferenceManager.userId
|
||||
val comments = if (data.isCommentAvailable) {
|
||||
val post = data.toUiModel()
|
||||
val isCommentVisible = data.isCommentAvailable && !post.isLocked
|
||||
val comments = if (isCommentVisible) {
|
||||
data.comments.comments.map { it.toUiModel(isCreatorOwner) }
|
||||
} else {
|
||||
emptyList()
|
||||
}
|
||||
_detailStateLiveData.value = CreatorChannelCommunityDetailUiState.Content(
|
||||
post = data.toUiModel(),
|
||||
isCommentAvailable = data.isCommentAvailable,
|
||||
isCommentInputVisible = data.isCommentAvailable,
|
||||
post = post,
|
||||
isCommentAvailable = isCommentVisible,
|
||||
isCommentInputVisible = isCommentVisible,
|
||||
comments = comments,
|
||||
commentPage = data.comments.page,
|
||||
hasNextComment = data.isCommentAvailable && data.comments.hasNext
|
||||
hasNextComment = isCommentVisible && data.comments.hasNext
|
||||
)
|
||||
}
|
||||
|
||||
@@ -439,7 +441,8 @@ class CreatorChannelCommunityDetailViewModel(
|
||||
isLiked = isLiked,
|
||||
isPinned = isPinned,
|
||||
isLocked = isLocked(),
|
||||
showPaywall = isLocked()
|
||||
showPaywall = isLocked(),
|
||||
showReaction = !isLocked()
|
||||
)
|
||||
|
||||
private fun CreatorChannelCommunityPostDetailResponse.isLocked(): Boolean {
|
||||
@@ -524,7 +527,8 @@ data class CreatorChannelCommunityPostDetailUiModel(
|
||||
val isLiked: Boolean,
|
||||
val isPinned: Boolean,
|
||||
val isLocked: Boolean,
|
||||
val showPaywall: Boolean
|
||||
val showPaywall: Boolean,
|
||||
val showReaction: Boolean
|
||||
)
|
||||
|
||||
data class CreatorChannelCommunityCommentUiModel(
|
||||
|
||||
Reference in New Issue
Block a user