Updated on 2026-08-14
This commit is contained in:
parent
e2f9d50499
commit
855d23a4e3
12 changed files with 19 additions and 3 deletions
|
|
@ -35,8 +35,8 @@ import com.tangem.core.ui.extensions.isNullOrEmpty
|
|||
import com.tangem.core.ui.extensions.resolveReference
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.core.ui.utils.singleEvent
|
||||
import com.tangem.core.ui.test.SendScreenTestTags
|
||||
import com.tangem.core.ui.utils.singleEvent
|
||||
|
||||
@Composable
|
||||
fun NavigationButtonsBlock(
|
||||
|
|
@ -78,7 +78,9 @@ fun NavigationButtonsBlockV2(
|
|||
horizontalArrangement = Arrangement.spacedBy(TangemTheme.dimens.spacing12),
|
||||
) {
|
||||
PreviousButton(navigationUM?.prevButton)
|
||||
NavigationPrimaryButton(navigationUM?.primaryButton, modifier = Modifier.weight(1f))
|
||||
key(navigationUM?.source) {
|
||||
NavigationPrimaryButton(navigationUM?.primaryButton, modifier = Modifier.weight(1f))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.tangem.core.ui.extensions.TextReference
|
|||
@Immutable
|
||||
sealed class NavigationUM {
|
||||
data class Content(
|
||||
val source: String,
|
||||
val title: TextReference,
|
||||
val subtitle: TextReference?,
|
||||
@DrawableRes val backIconRes: Int,
|
||||
|
|
|
|||
|
|
@ -523,6 +523,7 @@ internal class SendConfirmModel @Inject constructor(
|
|||
params.callback.onResult(
|
||||
state.copy(
|
||||
navigationUM = NavigationUM.Content(
|
||||
source = CommonSendRoute.Confirm.javaClass.simpleName,
|
||||
title = resourceReference(id = R.string.common_send),
|
||||
subtitle = null,
|
||||
backIconRes = when (confirmUM) {
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ internal class SendConfirmSuccessModel @Inject constructor(
|
|||
params.callback.onResult(
|
||||
state.copy(
|
||||
navigationUM = NavigationUM.Content(
|
||||
source = CommonSendRoute.ConfirmSuccess.javaClass.simpleName,
|
||||
title = stringReference(""),
|
||||
subtitle = null,
|
||||
backIconRes = R.drawable.ic_close_24,
|
||||
|
|
|
|||
|
|
@ -371,11 +371,12 @@ internal class NFTSendConfirmModel @Inject constructor(
|
|||
flow = uiState,
|
||||
flow2 = params.currentRoute,
|
||||
transform = { state, route -> state to route },
|
||||
).onEach { (state, _) ->
|
||||
).onEach { (state, route) ->
|
||||
val confirmUM = state.confirmUM
|
||||
params.callback.onResult(
|
||||
state.copy(
|
||||
navigationUM = NavigationUM.Content(
|
||||
source = CommonSendRoute.Confirm.javaClass.simpleName,
|
||||
title = resourceReference(R.string.nft_send),
|
||||
subtitle = null,
|
||||
backIconRes = when (confirmUM) {
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ internal class NFTSendSuccessModel @Inject constructor(
|
|||
params.callback.onResult(
|
||||
state.copy(
|
||||
navigationUM = NavigationUM.Content(
|
||||
source = CommonSendRoute.ConfirmSuccess.javaClass.simpleName,
|
||||
title = stringReference(""),
|
||||
subtitle = null,
|
||||
backIconRes = R.drawable.ic_close_24,
|
||||
|
|
|
|||
|
|
@ -378,6 +378,7 @@ internal class SendAmountModel @Inject constructor(
|
|||
setSendWithSwapAvailability()
|
||||
params.callback.onNavigationResult(
|
||||
NavigationUM.Content(
|
||||
source = CommonSendRoute.Amount::class.java.simpleName,
|
||||
title = resourceReference(R.string.send_amount_label),
|
||||
subtitle = null,
|
||||
backIconRes = if (route.isEditMode) {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import com.tangem.features.send.v2.api.entity.PredefinedValues
|
|||
import com.tangem.features.send.v2.api.subcomponents.destination.SendDestinationComponentParams
|
||||
import com.tangem.features.send.v2.api.subcomponents.destination.SendDestinationComponentParams.DestinationBlockParams
|
||||
import com.tangem.features.send.v2.api.subcomponents.destination.entity.DestinationUM
|
||||
import com.tangem.features.send.v2.common.CommonSendRoute
|
||||
import com.tangem.features.send.v2.impl.R
|
||||
import com.tangem.features.send.v2.subcomponents.destination.analytics.EnterAddressSource
|
||||
import com.tangem.features.send.v2.subcomponents.destination.analytics.SendDestinationAnalyticEvents
|
||||
|
|
@ -359,6 +360,7 @@ internal class SendDestinationModel @Inject constructor(
|
|||
).onEach { (state, route) ->
|
||||
params.callback.onNavigationResult(
|
||||
NavigationUM.Content(
|
||||
source = CommonSendRoute.Destination::class.java.simpleName,
|
||||
title = params.title,
|
||||
subtitle = null,
|
||||
backIconRes = if (route.isEditMode) {
|
||||
|
|
|
|||
|
|
@ -720,6 +720,7 @@ internal class SwapAmountModel @Inject constructor(
|
|||
).filter { (_, route) -> route is SendWithSwapRoute.Amount }.onEach { (state, route) ->
|
||||
params.callback.onNavigationResult(
|
||||
NavigationUM.Content(
|
||||
source = SendWithSwapRoute.Amount::class.java.simpleName,
|
||||
title = resourceReference(R.string.common_amount),
|
||||
subtitle = null,
|
||||
backIconRes = if (route.isEditMode) {
|
||||
|
|
|
|||
|
|
@ -428,6 +428,7 @@ internal class SendWithSwapConfirmModel @Inject constructor(
|
|||
route = SendWithSwapRoute.Confirm,
|
||||
sendWithSwapUM = state.copy(
|
||||
navigationUM = NavigationUM.Content(
|
||||
source = SendWithSwapRoute.Confirm.javaClass.simpleName,
|
||||
title = resourceReference(id = R.string.send_with_swap_confirm_title),
|
||||
subtitle = null,
|
||||
backIconRes = R.drawable.ic_back_24,
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.tangem.core.ui.extensions.TextReference
|
|||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.features.swap.v2.impl.R
|
||||
import com.tangem.features.swap.v2.impl.common.entity.ConfirmUM
|
||||
import com.tangem.features.swap.v2.impl.sendviaswap.SendWithSwapRoute
|
||||
import com.tangem.features.swap.v2.impl.sendviaswap.entity.SendWithSwapUM
|
||||
import com.tangem.features.swap.v2.impl.sendviaswap.success.SendWithSwapSuccessComponent
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
|
|
@ -40,6 +41,7 @@ internal class SendWithSwapSuccessModel @Inject constructor(
|
|||
private fun configConfirmSuccessNavigation() {
|
||||
params.callback.onNavigationResult(
|
||||
NavigationUM.Content(
|
||||
source = SendWithSwapRoute.Success.javaClass.simpleName,
|
||||
title = TextReference.EMPTY,
|
||||
subtitle = null,
|
||||
backIconRes = R.drawable.ic_close_24,
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ import com.tangem.features.swap.v2.impl.amount.entity.SwapAmountUM
|
|||
import com.tangem.features.swap.v2.impl.amount.ui.preview.SwapAmountContentPreview
|
||||
import com.tangem.features.swap.v2.impl.common.entity.ConfirmUM
|
||||
import com.tangem.features.swap.v2.impl.common.entity.SwapQuoteUM
|
||||
import com.tangem.features.swap.v2.impl.sendviaswap.SendWithSwapRoute
|
||||
import com.tangem.features.swap.v2.impl.sendviaswap.entity.SendWithSwapUM
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import java.math.BigDecimal
|
||||
|
|
@ -368,6 +369,7 @@ private fun SendWithSwapSuccessContent_Preview() {
|
|||
),
|
||||
),
|
||||
navigationUM = NavigationUM.Content(
|
||||
source = SendWithSwapRoute.Success.javaClass.simpleName,
|
||||
title = TextReference.EMPTY,
|
||||
subtitle = null,
|
||||
backIconRes = R.drawable.ic_close_24,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue