Updated on 2026-08-14
This commit is contained in:
parent
a68390f967
commit
c4636aaa16
4 changed files with 14 additions and 4 deletions
|
|
@ -97,6 +97,7 @@ internal object WalletPreviewData {
|
|||
url = null,
|
||||
fallbackResId = R.drawable.img_polygon_22,
|
||||
isGrayscale = false,
|
||||
isCustom = false,
|
||||
)
|
||||
|
||||
private val tokenIconState
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ internal class CryptoCurrencyToIconStateConverter : Converter<CryptoCurrencyStat
|
|||
url = coin.iconUrl,
|
||||
fallbackResId = coin.networkIconResId,
|
||||
isGrayscale = coin.network.isTestnet || isUnreachable,
|
||||
isCustom = coin.isCustom,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue