diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 4bb0770e41..ccbd670078 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -683,6 +683,7 @@ Earn staking rewards Staking in the %1$s network with a new validator will automatically transfer all previously staked funds to this validator Reinvests your earned rewards in your staked amount, increasing potential earnings. + Unlock your money to withdraw it from staking process. Unlocking takes %s. Your funds will be available for use after the 21-day unbonding period. Reward will be withdrawn along with your unstaking funds. Your funds will be available for use after the %s unbonding period. You can now withdraw your funds, it will be available to use immediately diff --git a/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/state/transformers/AddStakingNotificationsTransformer.kt b/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/state/transformers/AddStakingNotificationsTransformer.kt index 55740369f4..6f68eb4cc8 100644 --- a/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/state/transformers/AddStakingNotificationsTransformer.kt +++ b/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/state/transformers/AddStakingNotificationsTransformer.kt @@ -11,6 +11,7 @@ import com.tangem.common.ui.notifications.NotificationsFactory.addFeeUnreachable import com.tangem.common.ui.notifications.NotificationsFactory.addReserveAmountErrorNotification import com.tangem.common.ui.notifications.NotificationsFactory.addTransactionLimitErrorNotification import com.tangem.common.ui.notifications.NotificationsFactory.addValidateTransactionNotifications +import com.tangem.core.ui.extensions.pluralReference import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.extensions.wrappedList import com.tangem.domain.appcurrency.model.AppCurrency @@ -222,24 +223,40 @@ internal class AddStakingNotificationsTransformer( else -> { val confirmationState = prevState.confirmationState as? StakingStates.ConfirmationState.Data val pendingActionType = confirmationState?.pendingAction?.type - val (titleId, textId) = when (pendingActionType) { + val (titleReference, textReference) = when (pendingActionType) { StakingActionType.CLAIM_REWARDS -> { - R.string.common_claim to R.string.staking_notification_claim_rewards_text + resourceReference(R.string.common_claim) to + resourceReference(R.string.staking_notification_claim_rewards_text) } StakingActionType.RESTAKE_REWARDS -> { - R.string.staking_restake to R.string.staking_notification_restake_rewards_text + resourceReference(R.string.staking_restake) to + resourceReference(R.string.staking_notification_restake_rewards_text) } StakingActionType.WITHDRAW -> { - R.string.staking_withdraw to R.string.staking_notification_withdraw_text + resourceReference(R.string.staking_withdraw) to + resourceReference(R.string.staking_notification_withdraw_text) + } + StakingActionType.UNLOCK_LOCKED -> { + val cooldownPeriodDays = yield.metadata.cooldownPeriod.days + resourceReference(R.string.staking_unlocked_locked) to resourceReference( + R.string.staking_notification_unlock_text, + wrappedList( + pluralReference( + id = R.plurals.common_days, + count = cooldownPeriodDays, + formatArgs = wrappedList(cooldownPeriodDays), + ), + ), + ) } else -> null to null } - if (titleId != null && textId != null) { + if (titleReference != null && textReference != null) { add( StakingNotification.Info.PendingAction( - title = resourceReference(titleId), - text = resourceReference(textId), + title = titleReference, + text = textReference, ), ) }