From 912510da57b0728c08c8f63317064f6a2d4c9224 Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 8 Dec 2023 12:10:45 +0400 Subject: [PATCH] Updated on 2026-08-14 --- .../wallet/state/WalletAlertState.kt | 20 +++++++++++++++++++ .../viewmodels/intents/VisaWalletIntents.kt | 6 +++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletAlertState.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletAlertState.kt index 5b2a1cb935..300369728f 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletAlertState.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/WalletAlertState.kt @@ -3,6 +3,7 @@ package com.tangem.feature.wallet.presentation.wallet.state import androidx.compose.runtime.Immutable import com.tangem.core.ui.extensions.TextReference import com.tangem.core.ui.extensions.resourceReference +import com.tangem.core.ui.extensions.stringReference import com.tangem.feature.wallet.impl.R @Immutable @@ -38,4 +39,23 @@ internal sealed class WalletAlertState { override val message: TextReference = resourceReference(R.string.key_invalidated_warning_description) override val onConfirmClick: (() -> Unit)? = null } + + object VisaBalancesInfo : WalletAlertState() { + override val title: TextReference? = null + override val message: TextReference = stringReference( + value = "Available balance is actual funds available, considering pending transactions, " + + "blocked amounts, and debit balance to prevent overdrafts.", + ) + override val onConfirmClick: (() -> Unit)? = null + } + + object VisaLimitsInfo : WalletAlertState() { + override val title: TextReference? = null + override val message: TextReference = stringReference( + value = "Limits are needed to control costs, improve security, manage risk. " + + "You can spend 1 000 USDT during the week for card payments in shops and " + + "100 USDT for other transactions, e. g. subscriptions or debts.", + ) + override val onConfirmClick: (() -> Unit)? = null + } } \ No newline at end of file diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/VisaWalletIntents.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/VisaWalletIntents.kt index cc290a1099..fc0b879db4 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/VisaWalletIntents.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/VisaWalletIntents.kt @@ -4,10 +4,10 @@ import arrow.core.getOrElse import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfigContent import com.tangem.core.ui.components.bottomsheets.tokenreceive.TokenReceiveBottomSheetConfig import com.tangem.core.ui.components.bottomsheets.tokenreceive.mapToAddressModels -import com.tangem.core.ui.extensions.stringReference import com.tangem.domain.tokens.GetPrimaryCurrencyStatusUpdatesUseCase import com.tangem.domain.tokens.model.CryptoCurrencyStatus import com.tangem.domain.wallets.models.UserWalletId +import com.tangem.feature.wallet.presentation.wallet.state.WalletAlertState import com.tangem.feature.wallet.presentation.wallet.state.WalletEvent import com.tangem.feature.wallet.presentation.wallet.state2.WalletStateController import com.tangem.feature.wallet.presentation.wallet.state2.model.BalancesAndLimitsBottomSheetConfig @@ -101,10 +101,10 @@ internal class VisaWalletIntentsImplementor @Inject constructor( ) private fun showBalanceInfo() { - eventSender.send(WalletEvent.ShowToast(stringReference(value = "Not implemented yet"))) + eventSender.send(WalletEvent.ShowAlert(WalletAlertState.VisaBalancesInfo)) } private fun showLimitInfo() { - eventSender.send(WalletEvent.ShowToast(stringReference(value = "Not implemented yet"))) + eventSender.send(WalletEvent.ShowAlert(WalletAlertState.VisaLimitsInfo)) } } \ No newline at end of file