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

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

View File

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