feature(space): make sure to handle topic properly

This commit is contained in:
ganfra 2025-10-08 21:59:12 +02:00
parent dbc0c42e31
commit 9d05eb8e6f
7 changed files with 102 additions and 3 deletions

View file

@ -7,6 +7,7 @@
package io.element.android.libraries.matrix.ui.components
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@ -43,6 +44,7 @@ fun SpaceHeaderView(
numberOfMembers: Int,
modifier: Modifier = Modifier,
topicMaxLines: Int = Int.MAX_VALUE,
onTopicClick: ((String) -> Unit)? = null,
) {
RoomPreviewOrganism(
modifier = modifier.padding(24.dp),
@ -68,7 +70,16 @@ fun SpaceHeaderView(
description = if (topic.isNullOrBlank()) {
null
} else {
{ RoomPreviewDescriptionAtom(description = topic, maxLines = topicMaxLines) }
{
RoomPreviewDescriptionAtom(
description = topic,
maxLines = topicMaxLines,
modifier = Modifier.clickable(
enabled = onTopicClick != null,
onClick = { onTopicClick?.invoke(topic) }
)
)
}
},
memberCount = {
SpaceMembersView(