屏蔽关注动态页面的关注按钮

This commit is contained in:
2024-10-26 19:18:50 +08:00
parent 2012668361
commit e8ddd67219
2 changed files with 18 additions and 12 deletions

View File

@@ -71,7 +71,8 @@ fun MomentCard(
onFavoriteClick: () -> Unit = {},
onAddComment: () -> Unit = {},
onFollowClick: () -> Unit = {},
hideAction: Boolean = false
hideAction: Boolean = false,
showFollowButton: Boolean = true
) {
val AppColors = LocalAppTheme.current
var imageIndex by remember { mutableStateOf(0) }
@@ -84,7 +85,11 @@ fun MomentCard(
Box(
modifier = Modifier.padding(start = 16.dp, end = 16.dp, top = 16.dp, bottom = 8.dp)
) {
MomentTopRowGroup(momentEntity = momentEntity, onFollowClick = onFollowClick)
MomentTopRowGroup(
momentEntity = momentEntity,
onFollowClick = onFollowClick,
showFollowButton = showFollowButton
)
}
Column(
modifier = Modifier
@@ -223,6 +228,7 @@ fun MomentPostTime(time: String) {
@Composable
fun MomentTopRowGroup(
momentEntity: MomentEntity,
showFollowButton: Boolean = true,
onFollowClick: () -> Unit = {}
) {
val navController = LocalNavController.current
@@ -262,7 +268,6 @@ fun MomentTopRowGroup(
modifier = Modifier.weight(1f),
name = momentEntity.nickname
)
// MomentFollowBtn()
Spacer(modifier = Modifier.width(16.dp))
}
@@ -277,16 +282,16 @@ fun MomentTopRowGroup(
MomentPostLocation(momentEntity.location)
}
}
Spacer(modifier = Modifier.width(16.dp))
if (AppState.UserId != momentEntity.authorId) {
FollowButton(
isFollowing = momentEntity.followStatus
) {
onFollowClick()
if (showFollowButton) {
Spacer(modifier = Modifier.width(16.dp))
if (AppState.UserId != momentEntity.authorId) {
FollowButton(
isFollowing = momentEntity.followStatus
) {
onFollowClick()
}
}
}
}
}

View File

@@ -74,7 +74,8 @@ fun TimelineMomentsList() {
},
onFollowClick = {
model.followAction(momentItem)
}
},
showFollowButton = false
)
// Box(
// modifier = Modifier