Updated on 2026-08-14
This commit is contained in:
parent
86dc859a67
commit
006669ae0d
26 changed files with 281 additions and 87 deletions
|
|
@ -156,6 +156,8 @@ internal class DefaultNFTSendComponent @AssistedInject constructor(
|
|||
isBalanceHidingFlow = model.isBalanceHiddenFlow,
|
||||
onLoadFee = model::loadFee,
|
||||
analyticsSendSource = analyticsSendSource,
|
||||
account = model.account,
|
||||
isAccountsMode = model.isAccountsMode,
|
||||
onSendTransaction = { innerRouter.replaceAll(CommonSendRoute.ConfirmSuccess) },
|
||||
),
|
||||
)
|
||||
|
|
@ -181,6 +183,8 @@ internal class DefaultNFTSendComponent @AssistedInject constructor(
|
|||
callback = model,
|
||||
currentRoute = model.currentRouteFlow.filterIsInstance<CommonSendRoute.ConfirmSuccess>(),
|
||||
txUrl = txUrl,
|
||||
account = model.account,
|
||||
isAccountsMode = model.isAccountsMode,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.tangem.core.ui.decompose.ComposableContentComponent
|
|||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.wrappedList
|
||||
import com.tangem.domain.appcurrency.model.AppCurrency
|
||||
import com.tangem.domain.models.account.Account
|
||||
import com.tangem.domain.models.currency.CryptoCurrencyStatus
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.nft.models.NFTAsset
|
||||
|
|
@ -88,7 +89,9 @@ internal class NFTSendConfirmComponent @AssistedInject constructor(
|
|||
nftAsset = params.nftAsset,
|
||||
nftCollectionName = params.nftCollectionName,
|
||||
isSuccessScreen = false,
|
||||
title = resourceReference(R.string.send_from_wallet_name, wrappedList(params.userWallet.name)),
|
||||
account = params.account,
|
||||
isAccountsMode = params.isAccountsMode,
|
||||
walletTitle = resourceReference(R.string.send_from_wallet_name, wrappedList(params.userWallet.name)),
|
||||
),
|
||||
)
|
||||
|
||||
|
|
@ -150,6 +153,8 @@ internal class NFTSendConfirmComponent @AssistedInject constructor(
|
|||
val nftCollectionName: String,
|
||||
val cryptoCurrencyStatus: CryptoCurrencyStatus,
|
||||
val feeCryptoCurrencyStatus: CryptoCurrencyStatus,
|
||||
val account: Account.CryptoPortfolio?,
|
||||
val isAccountsMode: Boolean,
|
||||
val callback: ModelCallback,
|
||||
val currentRoute: Flow<CommonSendRoute.Confirm>,
|
||||
val isBalanceHidingFlow: StateFlow<Boolean>,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.tangem.core.decompose.context.child
|
|||
import com.tangem.core.decompose.model.getOrCreateModel
|
||||
import com.tangem.core.ui.decompose.ComposableContentComponent
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.domain.models.account.Account
|
||||
import com.tangem.domain.models.currency.CryptoCurrencyStatus
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.nft.models.NFTAsset
|
||||
|
|
@ -46,7 +47,9 @@ internal class NFTSendSuccessComponent @AssistedInject constructor(
|
|||
nftAsset = params.nftAsset,
|
||||
nftCollectionName = params.nftCollectionName,
|
||||
isSuccessScreen = true,
|
||||
title = resourceReference(R.string.nft_asset),
|
||||
account = params.account,
|
||||
isAccountsMode = params.isAccountsMode,
|
||||
walletTitle = resourceReference(R.string.nft_asset),
|
||||
),
|
||||
)
|
||||
|
||||
|
|
@ -86,6 +89,8 @@ internal class NFTSendSuccessComponent @AssistedInject constructor(
|
|||
val nftAsset: NFTAsset,
|
||||
val nftCollectionName: String,
|
||||
val txUrl: String,
|
||||
val account: Account.CryptoPortfolio?,
|
||||
val isAccountsMode: Boolean,
|
||||
val callback: ModelCallback,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -185,6 +185,14 @@ internal class SendAmountModel @Inject constructor(
|
|||
) {
|
||||
if (uiState.value is AmountState.Empty && userWallet != null) {
|
||||
val isOnlyOneWallet = getWalletsUseCase.invokeSync().size == 1
|
||||
val walletTitle = if (isOnlyOneWallet) {
|
||||
resourceReference(R.string.send_from_title)
|
||||
} else {
|
||||
resourceReference(
|
||||
R.string.send_from_wallet_name,
|
||||
WrappedList(listOf(userWallet?.name.orEmpty())), // TODO [REDACTED_TASK_KEY]
|
||||
)
|
||||
}
|
||||
_uiState.update {
|
||||
AmountStateConverter(
|
||||
clickIntents = this,
|
||||
|
|
@ -193,16 +201,14 @@ internal class SendAmountModel @Inject constructor(
|
|||
maxEnterAmount = maxAmountBoundary,
|
||||
iconStateConverter = CryptoCurrencyToIconStateConverter(),
|
||||
isBalanceHidden = params.isBalanceHidingFlow.value,
|
||||
accountTitleUM = AmountAccountConverter(
|
||||
isAccountsMode = isAccountsMode,
|
||||
walletTitle = walletTitle,
|
||||
prefixText = resourceReference(R.string.common_from),
|
||||
).convert(account),
|
||||
).convert(
|
||||
AmountParameters(
|
||||
title = if (isOnlyOneWallet) {
|
||||
resourceReference(R.string.send_from_title)
|
||||
} else {
|
||||
resourceReference(
|
||||
R.string.send_from_wallet_name,
|
||||
WrappedList(listOf(userWallet?.name.orEmpty())), // TODO [REDACTED_TASK_KEY]
|
||||
)
|
||||
},
|
||||
title = walletTitle,
|
||||
value = "",
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ private class SendAmountContentPreviewProvider : PreviewParameterProvider<Amount
|
|||
override val values: Sequence<AmountState>
|
||||
get() = sequenceOf(
|
||||
AmountStatePreviewData.amountStateV2,
|
||||
AmountStatePreviewData.amountStateV2Accounts,
|
||||
)
|
||||
}
|
||||
// endregion
|
||||
|
|
@ -201,7 +201,7 @@ class SendConfirmationNotificationsTransformerV2Test {
|
|||
|
||||
return AmountState.Data(
|
||||
isPrimaryButtonEnabled = true,
|
||||
title = mockk(relaxed = true),
|
||||
accountTitleUM = mockk(relaxed = true),
|
||||
availableBalanceCrypto = mockk(relaxed = true),
|
||||
availableBalanceFiat = mockk(relaxed = true),
|
||||
tokenName = mockk(relaxed = true),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue