Merge pull request #5493 from element-hq/feature/fga/space_description

feature(space): make sure to handle topic properly
This commit is contained in:
ganfra 2025-10-09 15:39:15 +02:00 committed by GitHub
commit be8455b54d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 239 additions and 57 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(