Updated on 2026-08-14

This commit is contained in:
Tangem 2024-09-03 10:12:05 +03:00
parent 66fb189749
commit d7374fb83f
5 changed files with 16 additions and 1 deletions

View file

@ -61,7 +61,9 @@ internal class StakingStateController @Inject constructor() {
private fun getInitialState(): StakingUiState {
return StakingUiState(
title = TextReference.EMPTY,
subtitle = null,
clickIntents = StakingClickIntentsStub,
walletName = "",
cryptoCurrencyName = "",
currentStep = StakingStep.InitialInfo,
initialInfoState = StakingStates.InitialInfoState.Empty(),

View file

@ -22,7 +22,9 @@ import java.math.BigDecimal
@Immutable
internal data class StakingUiState(
val title: TextReference,
val subtitle: TextReference?,
val clickIntents: StakingClickIntents,
val walletName: String,
val cryptoCurrencyName: String,
val currentStep: StakingStep,
val initialInfoState: StakingStates.InitialInfoState,

View file

@ -65,6 +65,7 @@ internal class SetInitialDataStateTransformer(
R.string.staking_title_stake,
wrappedList(cryptoCurrencyStatusProvider().currency.name),
),
walletName = userWalletProvider.invoke().name,
cryptoCurrencyName = cryptoCurrencyStatusProvider.invoke().currency.name,
clickIntents = clickIntents,
currentStep = StakingStep.InitialInfo,

View file

@ -1,6 +1,7 @@
package com.tangem.features.staking.impl.presentation.state.transformers
import com.tangem.core.ui.extensions.resourceReference
import com.tangem.core.ui.extensions.stringReference
import com.tangem.core.ui.extensions.wrappedList
import com.tangem.domain.staking.model.stakekit.action.StakingActionCommonType
import com.tangem.features.staking.impl.R
@ -36,6 +37,14 @@ internal object SetTitleTransformer : Transformer<StakingUiState> {
}
}
return prevState.copy(title = title)
val subtitle = when (currentStep) {
StakingStep.Confirmation -> stringReference(prevState.walletName)
else -> null
}
return prevState.copy(
title = title,
subtitle = subtitle,
)
}
}

View file

@ -97,6 +97,7 @@ private fun SendAppBar(uiState: StakingUiState) {
}
AppBarWithBackButtonAndIcon(
text = uiState.title.resolveReference(),
subtitle = uiState.subtitle?.resolveReference(),
backIconRes = backIcon,
onBackClick = uiState.clickIntents::onBackClick,
backgroundColor = TangemTheme.colors.background.secondary,