Updated on 2026-08-14

This commit is contained in:
Tangem 2026-02-20 13:19:26 +04:00
parent 3c00bf1966
commit 1ed2999163
3 changed files with 70 additions and 3 deletions

View file

@ -5,6 +5,9 @@ import com.tangem.common.ui.notifications.NotificationUM
import com.tangem.core.ui.extensions.TextReference
import com.tangem.domain.express.models.ExpressProvider
import com.tangem.domain.swap.models.SwapDataModel
import com.tangem.features.send.v2.api.entity.FeeSelectorUM
import com.tangem.features.send.v2.api.subcomponents.destination.entity.DestinationUM
import com.tangem.features.swap.v2.impl.amount.entity.SwapAmountUM
import kotlinx.collections.immutable.ImmutableList
@Immutable
@ -37,6 +40,9 @@ internal sealed class ConfirmUM {
val txUrl: String,
val swapDataModel: SwapDataModel,
val provider: ExpressProvider,
val amountUM: SwapAmountUM,
val destinationUM: DestinationUM,
val feeSelectorUM: FeeSelectorUM,
) : ConfirmUM()
data object Empty : ConfirmUM() {

View file

@ -20,6 +20,9 @@ internal class SendWithSwapConfirmSentStateTransformer(
txUrl = txUrl,
provider = provider,
swapDataModel = swapDataModel,
amountUM = prevState.amountUM,
destinationUM = prevState.destinationUM,
feeSelectorUM = prevState.feeSelectorUM,
),
)
}

View file

@ -93,10 +93,10 @@ internal fun SendWithSwapSuccessContent(sendWithSwapUM: SendWithSwapUM) {
@Composable
private fun SuccessContent(sendWithSwapUM: SendWithSwapUM, modifier: Modifier = Modifier) {
val confirmUM = sendWithSwapUM.confirmUM as? ConfirmUM.Success ?: return
val amountUM = sendWithSwapUM.amountUM as? SwapAmountUM.Content ?: return
val amountUM = confirmUM.amountUM as? SwapAmountUM.Content ?: return
val quoteUM = amountUM.selectedQuote as? SwapQuoteUM.Content ?: return
val destinationUM = sendWithSwapUM.destinationUM as? DestinationUM.Content ?: return
val feeSelectorUM = sendWithSwapUM.feeSelectorUM as? FeeSelectorUM.Content ?: return
val destinationUM = confirmUM.destinationUM as? DestinationUM.Content ?: return
val feeSelectorUM = confirmUM.feeSelectorUM as? FeeSelectorUM.Content ?: return
Column(
modifier = modifier
@ -393,6 +393,64 @@ private fun SendWithSwapSuccessContent_Preview() {
txExtraIdName = "Jeffry Blackwell",
),
),
amountUM = SwapAmountContentPreview.defaultState,
destinationUM = DestinationUM.Content(
isPrimaryButtonEnabled = false,
addressTextField = DestinationTextFieldUM.RecipientAddress(
value = "0x391316d97a07027a0702c8A002c8A0C25d8470",
keyboardOptions = KeyboardOptions(),
placeholder = TextReference.EMPTY,
label = resourceReference(R.string.send_recipient),
isError = false,
error = null,
isValuePasted = false,
blockchainAddress = "0x391316d97a07027a0702c8A002c8A0C25d8470",
),
memoTextField = DestinationTextFieldUM.RecipientMemo(
value = "123123123",
keyboardOptions = KeyboardOptions(),
placeholder = TextReference.EMPTY,
label = resourceReference(R.string.send_recipient),
isError = false,
error = null,
isValuePasted = false,
isEnabled = true,
disabledText = TextReference.EMPTY,
),
recent = persistentListOf(),
wallets = persistentListOf(),
networkName = "Polygon",
isValidating = false,
isInitialized = false,
isRecentHidden = false,
isAccountsMode = false,
),
feeSelectorUM = FeeSelectorUM.Content(
fees = TransactionFee.Single(
normal = Fee.Common(
BigDecimal.ONE.convertToSdkAmount(
SwapAmountContentPreview.cryptoCurrencyStatus,
),
),
),
feeItems = persistentListOf(),
selectedFeeItem = FeeItem.Market(
Fee.Common(
BigDecimal.ONE.convertToSdkAmount(
SwapAmountContentPreview.cryptoCurrencyStatus,
),
),
),
feeExtraInfo = FeeExtraInfo(
isFeeApproximate = false,
isFeeConvertibleToFiat = false,
isTronToken = false,
feeCryptoCurrencyStatus = SwapAmountContentPreview.cryptoCurrencyStatus,
),
feeFiatRateUM = null,
feeNonce = FeeNonce.None,
isPrimaryButtonEnabled = false,
),
),
navigationUM = NavigationUM.Content(
source = SendWithSwapRoute.Success.javaClass.simpleName,