Updated on 2026-08-14

This commit is contained in:
Tangem 2023-09-12 12:38:20 +03:00
parent a68390f967
commit c4636aaa16
4 changed files with 14 additions and 4 deletions

View file

@ -97,6 +97,7 @@ internal object WalletPreviewData {
url = null,
fallbackResId = R.drawable.img_polygon_22,
isGrayscale = false,
isCustom = false,
)
private val tokenIconState

View file

@ -84,7 +84,7 @@ private fun BoxScope.ContentIconContainer(icon: TokenItemState.IconState, modifi
)
}
if (icon is TokenItemState.IconState.CustomTokenIcon) {
if (icon.isCustom) {
CustomBadge(modifier = Modifier.align(Alignment.BottomEnd))
}
}

View file

@ -84,8 +84,9 @@ internal sealed interface TokenItemState {
@Immutable
sealed class IconState {
abstract val networkBadgeIconResId: Int?
abstract val isGrayscale: Boolean
abstract val isCustom: Boolean
abstract val networkBadgeIconResId: Int?
/**
* Represents a coin icon.
@ -98,6 +99,7 @@ internal sealed interface TokenItemState {
val url: String?,
@DrawableRes val fallbackResId: Int,
override val isGrayscale: Boolean,
override val isCustom: Boolean,
) : IconState() {
override val networkBadgeIconResId: Int? = null
@ -118,7 +120,10 @@ internal sealed interface TokenItemState {
override val isGrayscale: Boolean,
val fallbackTint: Color,
val fallbackBackground: Color,
) : IconState()
) : IconState() {
override val isCustom: Boolean = false
}
/**
* Represents a custom token icon.
@ -133,7 +138,10 @@ internal sealed interface TokenItemState {
val background: Color,
@DrawableRes override val networkBadgeIconResId: Int,
override val isGrayscale: Boolean,
) : IconState()
) : IconState() {
override val isCustom: Boolean = false
}
}
/** Token options state */

View file

@ -25,6 +25,7 @@ internal class CryptoCurrencyToIconStateConverter : Converter<CryptoCurrencyStat
url = coin.iconUrl,
fallbackResId = coin.networkIconResId,
isGrayscale = coin.network.isTestnet || isUnreachable,
isCustom = coin.isCustom,
)
}