Set avatar size value to dp

This commit is contained in:
Florian Renaud 2023-03-14 15:23:29 +01:00
parent a83b8283f4
commit 5a20c14524
4 changed files with 11 additions and 11 deletions

View file

@ -94,7 +94,7 @@ private fun InitialsAvatar(
Text(
modifier = Modifier.align(Alignment.Center),
text = avatarData.getInitial(),
fontSize = (avatarData.size.value / 2).sp,
fontSize = (avatarData.size.dp / 2).value.sp,
color = Color.White,
)
}

View file

@ -16,17 +16,16 @@
package io.element.android.libraries.designsystem.components.avatar
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
sealed class AvatarSize(open val value: Int) {
sealed class AvatarSize(open val dp: Dp) {
val dp get() = value.dp
object SMALL : AvatarSize(32)
object MEDIUM : AvatarSize(40)
object BIG : AvatarSize(48)
object HUGE : AvatarSize(96)
object SMALL : AvatarSize(32.dp)
object MEDIUM : AvatarSize(40.dp)
object BIG : AvatarSize(48.dp)
object HUGE : AvatarSize(96.dp)
// FIXME maybe remove this field and switch back to an enum (or remove this class) when design system will be integrated
data class Custom(override val value: Int) : AvatarSize(value)
data class Custom(override val dp: Dp) : AvatarSize(dp)
}