Updated on 2026-08-14

This commit is contained in:
Tangem 2023-12-26 22:07:21 +03:00
commit 9ff08a73fa
3 changed files with 10 additions and 3 deletions

View file

@ -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
}

View file

@ -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,
),
),
)

View file

@ -313,7 +313,7 @@ private fun SwapButton(state: SwapStateHolder, modifier: Modifier = Modifier) {
}
}
@Suppress("LongMethod")
@Suppress("LongMethod", "CyclomaticComplexMethod")
@Composable
private fun SwapWarnings(warnings: List<SwapWarning>) {
Column(
@ -369,6 +369,12 @@ private fun SwapWarnings(warnings: List<SwapWarning>) {
config = warning.notificationConfig,
)
}
is SwapWarning.GeneralInformational -> {
Notification(
config = warning.notificationConfig,
iconTint = TangemTheme.colors.icon.accent,
)
}
is SwapWarning.TransactionInProgressWarning -> {
CardWithIcon(
title = warning.title.resolveReference(),