From 3cb4019a305d84e82c06c709bccccfca957ce4fc Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 26 Dec 2023 22:05:51 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../com/tangem/feature/swap/models/SwapStateHolder.kt | 1 + .../main/java/com/tangem/feature/swap/ui/StateBuilder.kt | 4 ++-- .../java/com/tangem/feature/swap/ui/SwapScreenContent.kt | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/models/SwapStateHolder.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/models/SwapStateHolder.kt index 2ccc7c9571..d5e794a1a1 100644 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/models/SwapStateHolder.kt +++ b/features/swap/presentation/src/main/java/com/tangem/feature/swap/models/SwapStateHolder.kt @@ -145,6 +145,7 @@ sealed interface SwapWarning { data class TooSmallAmountWarning(val notificationConfig: NotificationConfig) : SwapWarning data class UnableToCoverFeeWarning(val notificationConfig: NotificationConfig) : SwapWarning data class GeneralWarning(val notificationConfig: NotificationConfig) : SwapWarning + data class GeneralInformational(val notificationConfig: NotificationConfig) : SwapWarning data class TransactionInProgressWarning(val title: TextReference, val description: TextReference) : SwapWarning } diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt index cadb2e5087..e761bee9de 100644 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt +++ b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt @@ -369,7 +369,7 @@ internal class StateBuilder( when (it) { is Warning.ExistentialDepositWarning -> { warnings.add( - SwapWarning.GeneralWarning( + SwapWarning.GeneralInformational( NotificationConfig( title = resourceReference(R.string.warning_existential_deposit_title), subtitle = resourceReference( @@ -379,7 +379,7 @@ internal class StateBuilder( it.existentialDeposit.toPlainString(), ), ), - iconResId = R.drawable.img_attention_20, + iconResId = R.drawable.ic_alert_circle_24, ), ), ) diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapScreenContent.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapScreenContent.kt index e3c408bde2..cb4d02dbf9 100644 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapScreenContent.kt +++ b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapScreenContent.kt @@ -313,7 +313,7 @@ private fun SwapButton(state: SwapStateHolder, modifier: Modifier = Modifier) { } } -@Suppress("LongMethod") +@Suppress("LongMethod", "CyclomaticComplexMethod") @Composable private fun SwapWarnings(warnings: List) { Column( @@ -369,6 +369,12 @@ private fun SwapWarnings(warnings: List) { config = warning.notificationConfig, ) } + is SwapWarning.GeneralInformational -> { + Notification( + config = warning.notificationConfig, + iconTint = TangemTheme.colors.icon.accent, + ) + } is SwapWarning.TransactionInProgressWarning -> { CardWithIcon( title = warning.title.resolveReference(),