Skip to content

Commit

Permalink
feat(Avatar): Add Large UserAvatarStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
abdelkrim.mokhefi authored and amokhefi committed Jan 28, 2024
1 parent 3882a42 commit 7474d11
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public fun UserAvatar(
public enum class UserAvatarStyle(public val imageSize: Dp, public val badgeSize: Dp, public val badgeOffset: Dp) {
SMALL(imageSize = 32.dp, badgeSize = 9.dp, badgeOffset = (-1).dp),
MEDIUM(imageSize = 40.dp, badgeSize = 9.dp, badgeOffset = (-1).dp),
LARGE(imageSize = 64.dp, badgeSize = 12.dp, badgeOffset = (-4).dp),
}

@Preview(
Expand All @@ -166,6 +167,13 @@ internal fun UserAvatarPreview(
@PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
) {
PreviewTheme(theme) {
SparkUserAvatar(
style = UserAvatarStyle.LARGE,
model = "",
isPro = false,
isOnline = true,
transform = { AsyncImagePainter.State.Empty },
)
SparkUserAvatar(
style = UserAvatarStyle.MEDIUM,
model = "",
Expand All @@ -180,6 +188,13 @@ internal fun UserAvatarPreview(
isOnline = true,
transform = { AsyncImagePainter.State.Empty },
)
SparkUserAvatar(
style = UserAvatarStyle.LARGE,
model = "",
isPro = true,
isOnline = false,
transform = { AsyncImagePainter.State.Empty },
)
SparkUserAvatar(
style = UserAvatarStyle.MEDIUM,
model = "",
Expand Down

0 comments on commit 7474d11

Please sign in to comment.