Move isTombstoned to AvatarType.Space

This commit is contained in:
Benoit Marty 2025-06-23 18:31:14 +02:00
parent a76730c365
commit 0f6dd82b97
2 changed files with 6 additions and 4 deletions

View file

@ -23,5 +23,6 @@ sealed interface AvatarType {
data class Space( data class Space(
val cornerSize: Dp, val cornerSize: Dp,
val isTombstoned: Boolean = false,
) : AvatarType ) : AvatarType
} }

View file

@ -23,12 +23,11 @@ fun SpaceAvatar(
avatarData: AvatarData, avatarData: AvatarData,
avatarType: AvatarType.Space, avatarType: AvatarType.Space,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
isTombstoned: Boolean = false,
hideAvatarImage: Boolean = false, hideAvatarImage: Boolean = false,
contentDescription: String? = null, contentDescription: String? = null,
) { ) {
when { when {
isTombstoned -> TombstonedRoomAvatar( avatarType.isTombstoned -> TombstonedRoomAvatar(
size = avatarData.size, size = avatarData.size,
avatarType = avatarType, avatarType = avatarType,
modifier = modifier, modifier = modifier,
@ -67,8 +66,10 @@ internal fun SpaceAvatarPreview() =
) )
SpaceAvatar( SpaceAvatar(
avatarData = anAvatarData(), avatarData = anAvatarData(),
avatarType = AvatarType.Space(cornerSize = 16.dp), avatarType = AvatarType.Space(
isTombstoned = true, cornerSize = 16.dp,
isTombstoned = true,
),
) )
} }
} }