Move isTombstoned to AvatarType.Space

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

View file

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

View file

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