Updated on 2026-08-14
This commit is contained in:
commit
714eb51ce5
34 changed files with 345 additions and 114 deletions
|
|
@ -20,6 +20,7 @@ import com.tangem.domain.models.wallet.UserWalletId
|
|||
import com.tangem.domain.nft.models.NFTAsset
|
||||
import com.tangem.domain.onramp.model.OnrampSource
|
||||
import com.tangem.domain.pay.TangemPayDetailsConfig
|
||||
import com.tangem.domain.tokens.model.details.NavigationAction
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@SuppressLint("UnsafeOptInUsageError")
|
||||
|
|
@ -55,6 +56,7 @@ sealed class AppRoute(val path: String) : Route {
|
|||
data class CurrencyDetails(
|
||||
val userWalletId: UserWalletId,
|
||||
val currency: CryptoCurrency,
|
||||
val navigationAction: NavigationAction? = null,
|
||||
) : AppRoute(path = "/currency_details/${userWalletId.stringValue}/${currency.id.value}")
|
||||
|
||||
@Serializable
|
||||
|
|
|
|||
|
|
@ -48,8 +48,11 @@ class TokenItemStateConverter(
|
|||
private val iconStateProvider: (CryptoCurrencyStatus) -> CurrencyIconState = {
|
||||
CryptoCurrencyToIconStateConverter().convert(it)
|
||||
},
|
||||
private val onApyLabelClick: ((CryptoCurrencyStatus) -> Unit)? = null,
|
||||
private val titleStateProvider: (CryptoCurrencyStatus) -> TokenItemState.TitleState = {
|
||||
createTitleState(it, yieldModuleApyMap, stakingApyMap)
|
||||
createTitleState(it, yieldModuleApyMap, stakingApyMap, {
|
||||
onApyLabelClick?.invoke(it)
|
||||
})
|
||||
},
|
||||
private val subtitleStateProvider: (CryptoCurrencyStatus) -> TokenItemState.SubtitleState? = {
|
||||
createSubtitleState(it, appCurrency)
|
||||
|
|
@ -102,6 +105,9 @@ class TokenItemStateConverter(
|
|||
onItemLongClick = onItemLongClick?.let { onItemLongClick ->
|
||||
{ onItemLongClick(it, this) }
|
||||
},
|
||||
onApyLabelClick = onApyLabelClick?.let { onApyLabelClick ->
|
||||
{ onApyLabelClick(this) }
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -160,6 +166,7 @@ class TokenItemStateConverter(
|
|||
currencyStatus: CryptoCurrencyStatus,
|
||||
yieldModuleApyMap: Map<String, String>,
|
||||
stakingApyMap: Map<String, List<Yield.Validator>>,
|
||||
onApyLabelClick: () -> Unit,
|
||||
): TokenItemState.TitleState {
|
||||
return when (val value = currencyStatus.value) {
|
||||
is CryptoCurrencyStatus.Loading,
|
||||
|
|
@ -184,6 +191,7 @@ class TokenItemStateConverter(
|
|||
hasPending = value.hasCurrentNetworkTransactions,
|
||||
earnApy = earnApyText,
|
||||
earnApyIsActive = isActive,
|
||||
onApyLabelClick = onApyLabelClick,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue