Move isTombstoned to AvatarType.Space
This commit is contained in:
parent
a76730c365
commit
0f6dd82b97
2 changed files with 6 additions and 4 deletions
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue