Updated on 2026-08-14
This commit is contained in:
parent
ce5f535ac5
commit
b04f28cf04
2 changed files with 6 additions and 1 deletions
|
|
@ -32,6 +32,7 @@ import com.tangem.core.ui.format.bigdecimal.uncapped
|
|||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.core.ui.test.BaseAmountBlockTestTags
|
||||
import com.tangem.utils.StringsSigns
|
||||
|
||||
@Composable
|
||||
fun AmountBlockV2(
|
||||
|
|
@ -39,6 +40,7 @@ fun AmountBlockV2(
|
|||
isClickDisabled: Boolean,
|
||||
isEditingDisabled: Boolean,
|
||||
modifier: Modifier = Modifier,
|
||||
showApproximatePrefix: Boolean = false,
|
||||
onClick: (() -> Unit)? = null,
|
||||
extraContent: @Composable () -> Unit = {},
|
||||
) {
|
||||
|
|
@ -71,7 +73,7 @@ fun AmountBlockV2(
|
|||
balance = amountState.availableBalanceCrypto,
|
||||
currencyTitle = currencyTitle,
|
||||
currencyIconState = amountState.tokenIconState,
|
||||
firstAmount = firstAmount,
|
||||
firstAmount = if (showApproximatePrefix) StringsSigns.TILDE_SIGN + firstAmount else firstAmount,
|
||||
secondAmount = secondAmount,
|
||||
isClickDisabled = isClickDisabled,
|
||||
isEditingDisabled = isEditingDisabled,
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import com.tangem.core.ui.extensions.resourceReference
|
|||
import com.tangem.core.ui.extensions.stringResourceSafe
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.domain.express.models.ExpressRateType
|
||||
import com.tangem.domain.swap.models.SwapAmountType
|
||||
import com.tangem.features.swap.v2.impl.R
|
||||
import com.tangem.features.swap.v2.impl.amount.entity.PriceImpact
|
||||
|
|
@ -120,11 +121,13 @@ private fun ConstraintLayoutScope.SwapAmountBlock(
|
|||
end.linkTo(parent.end)
|
||||
},
|
||||
)
|
||||
val isFloatRate = amountUM.swapRateType == ExpressRateType.Float
|
||||
AmountBlockV2(
|
||||
amountState = (amountUM.secondaryAmount.amountField as? AmountState.Data)?.copy(
|
||||
accountTitleUM = AccountTitleUM.Text(resourceReference(R.string.send_with_swap_recipient_amount_title)),
|
||||
availableBalanceCrypto = TextReference.EMPTY,
|
||||
) ?: amountUM.secondaryAmount.amountField,
|
||||
showApproximatePrefix = isFloatRate,
|
||||
isClickDisabled = true,
|
||||
isEditingDisabled = false,
|
||||
modifier = Modifier.constrainAs(toAmountRef) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue