Updated on 2026-08-14

This commit is contained in:
Tangem 2026-02-06 13:54:38 +05:00
parent 9d73e02d69
commit f9226ab6bf
19 changed files with 106 additions and 63 deletions

View file

@ -1,13 +1,16 @@
package com.tangem.features.onramp.tokenlist.entity.utils
import com.tangem.common.getTotalCryptoAmount
import com.tangem.common.getTotalFiatAmount
import com.tangem.common.ui.tokens.TokenItemStateConverter
import com.tangem.common.ui.tokens.TokenItemStateConverter.Companion.getFormattedCryptoAmount
import com.tangem.common.ui.tokens.TokenItemStateConverter.Companion.getFormattedFiatAmount
import com.tangem.common.ui.tokens.TokenItemStateConverter.Companion.isFlickering
import com.tangem.core.ui.components.currency.icon.converter.CryptoCurrencyToIconStateConverter
import com.tangem.core.ui.components.token.state.TokenItemState
import com.tangem.core.ui.extensions.TextReference
import com.tangem.core.ui.extensions.stringReference
import com.tangem.core.ui.format.bigdecimal.crypto
import com.tangem.core.ui.format.bigdecimal.fiat
import com.tangem.core.ui.format.bigdecimal.format
import com.tangem.domain.appcurrency.model.AppCurrency
import com.tangem.domain.models.currency.CryptoCurrencyStatus
@ -112,7 +115,9 @@ internal object OnrampTokenItemStateConverterFactory {
is CryptoCurrencyStatus.NoAccount,
-> {
TokenItemState.Subtitle2State.TextContent(
text = status.getFormattedCryptoAmount(),
text = status.getTotalCryptoAmount().format {
crypto(cryptoCurrency = status.currency)
},
isFlickering = status.value.isFlickering(),
)
}
@ -136,7 +141,12 @@ internal object OnrampTokenItemStateConverterFactory {
is CryptoCurrencyStatus.NoAccount,
-> {
TokenItemState.FiatAmountState.TextContent(
text = status.getFormattedFiatAmount(appCurrency = appCurrency),
text = status.getTotalFiatAmount().format {
fiat(
fiatCurrencyCode = appCurrency.code,
fiatCurrencySymbol = appCurrency.symbol,
)
},
isAvailable = isAvailable,
isFlickering = status.value.isFlickering(),
)