Updated on 2026-08-14
This commit is contained in:
parent
8aa158cdb6
commit
40e24712d5
6 changed files with 7 additions and 11 deletions
|
|
@ -107,6 +107,6 @@ internal object TokenDetailsPreviewData {
|
|||
pullToRefreshConfig = pullToRefreshConfig,
|
||||
bottomSheetConfig = null,
|
||||
isBalanceHidden = false,
|
||||
isCustomToken = false,
|
||||
isMarketPriceAvailable = false,
|
||||
)
|
||||
}
|
||||
|
|
@ -22,5 +22,5 @@ internal data class TokenDetailsState(
|
|||
val pullToRefreshConfig: TokenDetailsPullToRefreshConfig,
|
||||
val bottomSheetConfig: TangemBottomSheetConfig?,
|
||||
val isBalanceHidden: Boolean,
|
||||
val isCustomToken: Boolean,
|
||||
val isMarketPriceAvailable: Boolean,
|
||||
)
|
||||
|
|
@ -29,7 +29,7 @@ internal class TokenDetailsIconStateConverter : Converter<CryptoCurrency, TokenI
|
|||
val background = token.tryGetBackgroundForTokenIcon(isGrayscale)
|
||||
val tint = getTintForTokenIcon(background)
|
||||
|
||||
return if (token.isCustom) {
|
||||
return if (token.isCustom && token.iconUrl == null) {
|
||||
TokenInfoBlockState.IconState.CustomTokenIcon(
|
||||
tint = tint,
|
||||
background = background,
|
||||
|
|
|
|||
|
|
@ -61,19 +61,15 @@ internal class TokenDetailsLoadedBalanceConverter(
|
|||
return when (status.value) {
|
||||
is CryptoCurrencyStatus.NoQuote,
|
||||
is CryptoCurrencyStatus.Loaded,
|
||||
is CryptoCurrencyStatus.NoAccount,
|
||||
is CryptoCurrencyStatus.Custom,
|
||||
-> TokenDetailsBalanceBlockState.Content(
|
||||
actionButtons = currentState.actionButtons,
|
||||
fiatBalance = formatFiatAmount(status.value, appCurrencyProvider()),
|
||||
cryptoBalance = formatCryptoAmount(status),
|
||||
)
|
||||
is CryptoCurrencyStatus.NoAccount -> TokenDetailsBalanceBlockState.Content(
|
||||
actionButtons = currentState.actionButtons,
|
||||
fiatBalance = formatFiatAmount(status.value, appCurrencyProvider()),
|
||||
cryptoBalance = formatCryptoAmount(status),
|
||||
)
|
||||
is CryptoCurrencyStatus.Loading -> TokenDetailsBalanceBlockState.Loading(currentState.actionButtons)
|
||||
is CryptoCurrencyStatus.MissedDerivation,
|
||||
is CryptoCurrencyStatus.Custom,
|
||||
is CryptoCurrencyStatus.Unreachable,
|
||||
is CryptoCurrencyStatus.NoAmount,
|
||||
-> TokenDetailsBalanceBlockState.Error(currentState.actionButtons)
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ internal class TokenDetailsSkeletonStateConverter(
|
|||
pullToRefreshConfig = createPullToRefresh(),
|
||||
bottomSheetConfig = null,
|
||||
isBalanceHidden = true,
|
||||
isCustomToken = value is CryptoCurrency.Token && value.isCustom,
|
||||
isMarketPriceAvailable = value.id.rawCurrencyId != null,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ internal fun TokenDetailsScreen(state: TokenDetailsState) {
|
|||
)
|
||||
},
|
||||
)
|
||||
if (!state.isCustomToken) {
|
||||
if (state.isMarketPriceAvailable) {
|
||||
item(
|
||||
key = MarketPriceBlockState::class.java,
|
||||
contentType = MarketPriceBlockState::class.java,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue