Updated on 2026-08-14

This commit is contained in:
Tangem 2024-09-09 17:16:46 +05:00
parent 9925da2864
commit a16a9e80ba
14 changed files with 121 additions and 62 deletions

View file

@ -104,7 +104,9 @@ internal class AddStakingNotificationsTransformer(
return prevState.copy(
confirmationState = confirmationState.copy(
notifications = notifications.toImmutableList(),
isPrimaryButtonEnabled = notifications.any { it is StakingNotification.Error },
isPrimaryButtonEnabled = notifications.none {
it is StakingNotification.Error || it is NotificationUM.Error
},
),
)
}

View file

@ -9,13 +9,13 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.tangem.common.ui.amountScreen.models.AmountState
import com.tangem.common.ui.amountScreen.preview.AmountStatePreviewData
import com.tangem.common.ui.amountScreen.ui.AmountBlock
import com.tangem.core.ui.components.transactions.TransactionDoneTitle
import com.tangem.core.ui.extensions.resourceReference
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemThemePreview
import com.tangem.domain.staking.model.stakekit.action.StakingActionCommonType
@ -52,10 +52,9 @@ internal fun StakingConfirmationContent(
visible = doneState is TransactionDoneState.Content,
modifier = Modifier.padding(vertical = TangemTheme.dimens.spacing12),
) {
val transactionDoneStateContent = remember(this) { doneState as TransactionDoneState.Content }
TransactionDoneTitle(
titleRes = R.string.sent_transaction_sent_title,
date = transactionDoneStateContent.timestamp,
title = resourceReference(R.string.common_in_progress),
subtitle = resourceReference(R.string.staking_transaction_in_progress_text),
)
}
AmountBlock(

View file

@ -55,10 +55,9 @@ internal fun StakingFeeBlock(feeState: FeeState, isTransactionSent: Boolean) {
when (feeState) {
is FeeState.Content -> {
val feeAmount = feeState.fee?.amount
val (title, icon) = R.string.common_fee_selector_option_market to R.drawable.ic_bird_24
SelectorRowItem(
titleRes = title,
iconRes = icon,
titleRes = R.string.common_fee_selector_option_market,
iconRes = R.drawable.ic_bird_24,
preDot = stringReference(
BigDecimalFormatter.formatCryptoFeeAmount(
cryptoAmount = feeAmount?.value,
@ -80,9 +79,19 @@ internal fun StakingFeeBlock(feeState: FeeState, isTransactionSent: Boolean) {
)
}
is FeeState.Loading -> {
SelectorRowItem(
titleRes = R.string.common_fee_selector_option_market,
iconRes = R.drawable.ic_bird_24,
paddingValues = PaddingValues(),
)
FeeLoading(feeState)
}
is FeeState.Error -> {
SelectorRowItem(
titleRes = R.string.common_fee_selector_option_market,
iconRes = R.drawable.ic_bird_24,
paddingValues = PaddingValues(),
)
FeeError(feeState)
}
}