feature(space): make sure to handle topic properly
This commit is contained in:
parent
dbc0c42e31
commit
9d05eb8e6f
7 changed files with 102 additions and 3 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue