feat: 贴子页面标题点击进吧

This commit is contained in:
HuanCheng65 2023-07-13 23:15:05 +08:00
parent c4f9ad8718
commit 3928df1132
No known key found for this signature in database
GPG Key ID: 5EC9DD60A32C7360
1 changed files with 11 additions and 0 deletions

View File

@ -110,6 +110,7 @@ import com.huanchengfly.tieba.post.toastShort
import com.huanchengfly.tieba.post.ui.common.PbContentRender
import com.huanchengfly.tieba.post.ui.common.theme.compose.ExtendedTheme
import com.huanchengfly.tieba.post.ui.page.ProvideNavigator
import com.huanchengfly.tieba.post.ui.page.destinations.ForumPageDestination
import com.huanchengfly.tieba.post.ui.widgets.compose.Avatar
import com.huanchengfly.tieba.post.ui.widgets.compose.BackNavigationIcon
import com.huanchengfly.tieba.post.ui.widgets.compose.Button
@ -816,6 +817,14 @@ fun ThreadPage(
TopBar(
forum = forum,
onBack = { navigator.navigateUp() },
onForumClick = {
val forumName = forum?.get { name }
if (forumName != null) navigator.navigate(
ForumPageDestination(
forumName
)
)
},
modifier = Modifier.statusBarsPadding()
)
},
@ -1076,6 +1085,7 @@ fun ThreadPage(
private fun TopBar(
forum: ImmutableHolder<SimpleForum>?,
onBack: () -> Unit,
onForumClick: () -> Unit,
modifier: Modifier = Modifier
) {
TitleCentredToolbar(
@ -1087,6 +1097,7 @@ private fun TopBar(
.height(IntrinsicSize.Min)
.clip(RoundedCornerShape(100))
.background(ExtendedTheme.colors.chip)
.clickable(onClick = onForumClick)
.padding(4.dp),
verticalAlignment = Alignment.CenterVertically
) {