From 3928df1132591dde6ee5a607ffe54c09ee082816 Mon Sep 17 00:00:00 2001 From: HuanCheng65 <22636177+HuanCheng65@users.noreply.github.com> Date: Thu, 13 Jul 2023 23:15:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B4=B4=E5=AD=90=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E7=82=B9=E5=87=BB=E8=BF=9B=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tieba/post/ui/page/thread/ThreadPage.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/thread/ThreadPage.kt b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/thread/ThreadPage.kt index ea3be649..09f82f2d 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/thread/ThreadPage.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/thread/ThreadPage.kt @@ -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?, 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 ) {