Updated on 2026-08-14
This commit is contained in:
parent
5e854cd424
commit
7ff4227443
14 changed files with 63 additions and 21 deletions
|
|
@ -150,7 +150,7 @@ internal class AddExistingWalletModel @Inject constructor(
|
|||
|
||||
inner class MobileWalletSetupFinishedComponentModelCallbacks :
|
||||
MobileWalletSetupFinishedComponent.ModelCallbacks {
|
||||
override fun onContinueClick() {
|
||||
override fun onFinishClick() {
|
||||
router.replaceAll(AppRoute.Wallet)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ internal class MobileWalletSetupFinishedComponent @AssistedInject constructor(
|
|||
}
|
||||
|
||||
interface ModelCallbacks {
|
||||
fun onContinueClick()
|
||||
fun onFinishClick()
|
||||
}
|
||||
|
||||
data class Params(
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ internal class MobileWalletSetupFinishedModel @Inject constructor(
|
|||
internal val uiState: StateFlow<MobileWalletSetupFinishedUM>
|
||||
field = MutableStateFlow(
|
||||
MobileWalletSetupFinishedUM(
|
||||
onContinueClick = params.callbacks::onContinueClick,
|
||||
onFinishClick = params.callbacks::onFinishClick,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
package com.tangem.features.hotwallet.setupfinished.entity
|
||||
|
||||
internal data class MobileWalletSetupFinishedUM(
|
||||
val onContinueClick: () -> Unit,
|
||||
val onFinishClick: () -> Unit,
|
||||
)
|
||||
|
|
@ -70,7 +70,7 @@ internal fun MobileWalletSetupFinishedContent(state: MobileWalletSetupFinishedUM
|
|||
top = 12.dp,
|
||||
end = 48.dp,
|
||||
),
|
||||
text = stringResourceSafe(R.string.backup_complete_description),
|
||||
text = stringResourceSafe(R.string.onboarding_done_wallet),
|
||||
style = TangemTheme.typography.body1,
|
||||
color = TangemTheme.colors.text.secondary,
|
||||
textAlign = TextAlign.Center,
|
||||
|
|
@ -78,10 +78,10 @@ internal fun MobileWalletSetupFinishedContent(state: MobileWalletSetupFinishedUM
|
|||
Spacer(modifier = Modifier.weight(2f))
|
||||
PrimaryButton(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
text = stringResourceSafe(R.string.common_continue),
|
||||
text = stringResourceSafe(R.string.common_finish),
|
||||
showProgress = false,
|
||||
enabled = true,
|
||||
onClick = state.onContinueClick,
|
||||
onClick = state.onFinishClick,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ private fun PreviewMobileWalletSetupFinishedContent() {
|
|||
TangemThemePreview {
|
||||
MobileWalletSetupFinishedContent(
|
||||
state = MobileWalletSetupFinishedUM(
|
||||
onContinueClick = {},
|
||||
onFinishClick = {},
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.fillMaxSize
|
|||
import androidx.compose.foundation.layout.imePadding
|
||||
import androidx.compose.foundation.layout.systemBarsPadding
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import com.arkivanov.decompose.extensions.compose.stack.Children
|
||||
import com.arkivanov.decompose.extensions.compose.stack.animation.slide
|
||||
|
|
@ -31,11 +32,19 @@ internal fun SetAccessCodeContent(
|
|||
.imePadding()
|
||||
.systemBarsPadding(),
|
||||
) {
|
||||
TangemTopAppBar(
|
||||
modifier = Modifier,
|
||||
title = stringResourceSafe(R.string.access_code_navtitle),
|
||||
startButton = TopAppBarButtonUM.Back(onBackClick),
|
||||
)
|
||||
if (stackState.active.configuration is UpdateAccessCodeRoute.SetupFinished) {
|
||||
TangemTopAppBar(
|
||||
modifier = Modifier,
|
||||
title = stringResourceSafe(R.string.access_code_navtitle),
|
||||
titleAlignment = Alignment.CenterHorizontally,
|
||||
)
|
||||
} else {
|
||||
TangemTopAppBar(
|
||||
modifier = Modifier,
|
||||
title = stringResourceSafe(R.string.access_code_navtitle),
|
||||
startButton = TopAppBarButtonUM.Back(onBackClick),
|
||||
)
|
||||
}
|
||||
Children(
|
||||
stack = stackState,
|
||||
animation = stackAnimation(slide()),
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.tangem.domain.models.wallet.UserWalletId
|
|||
import com.tangem.features.hotwallet.UpdateAccessCodeComponent
|
||||
import com.tangem.features.hotwallet.updateaccesscode.routing.UpdateAccessCodeRoute
|
||||
import com.tangem.features.hotwallet.accesscode.AccessCodeComponent
|
||||
import com.tangem.features.hotwallet.setupfinished.MobileWalletSetupFinishedComponent
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import javax.inject.Inject
|
||||
|
|
@ -27,11 +28,13 @@ internal class UpdateAccessCodeModel @Inject constructor(
|
|||
val stackNavigation = StackNavigation<UpdateAccessCodeRoute>()
|
||||
val startRoute: UpdateAccessCodeRoute = UpdateAccessCodeRoute.SetAccessCode(params.userWalletId)
|
||||
val currentRoute: MutableStateFlow<UpdateAccessCodeRoute> = MutableStateFlow(startRoute)
|
||||
val mobileWalletSetupFinishedComponentModelCallbacks = MobileWalletSetupFinishedComponentModelCallbacks()
|
||||
|
||||
fun onChildBack() {
|
||||
when (currentRoute.value) {
|
||||
is UpdateAccessCodeRoute.SetAccessCode -> router.pop()
|
||||
is UpdateAccessCodeRoute.ConfirmAccessCode -> stackNavigation.pop()
|
||||
is UpdateAccessCodeRoute.SetupFinished -> Unit
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -40,6 +43,16 @@ internal class UpdateAccessCodeModel @Inject constructor(
|
|||
}
|
||||
|
||||
override fun onAccessCodeUpdated(userWalletId: UserWalletId) {
|
||||
router.pop()
|
||||
if (params.isFirstSetup) {
|
||||
stackNavigation.push(UpdateAccessCodeRoute.SetupFinished)
|
||||
} else {
|
||||
router.pop()
|
||||
}
|
||||
}
|
||||
|
||||
inner class MobileWalletSetupFinishedComponentModelCallbacks : MobileWalletSetupFinishedComponent.ModelCallbacks {
|
||||
override fun onFinishClick() {
|
||||
router.pop()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import com.tangem.core.decompose.context.AppComponentContext
|
|||
import com.tangem.core.ui.decompose.ComposableContentComponent
|
||||
import com.tangem.features.hotwallet.updateaccesscode.UpdateAccessCodeModel
|
||||
import com.tangem.features.hotwallet.accesscode.AccessCodeComponent
|
||||
import com.tangem.features.hotwallet.setupfinished.MobileWalletSetupFinishedComponent
|
||||
import javax.inject.Inject
|
||||
|
||||
internal class UpdateAccessCodeChildFactory @Inject constructor(
|
||||
|
|
@ -31,6 +32,12 @@ internal class UpdateAccessCodeChildFactory @Inject constructor(
|
|||
callbacks = model,
|
||||
),
|
||||
)
|
||||
is UpdateAccessCodeRoute.SetupFinished -> MobileWalletSetupFinishedComponent(
|
||||
context = childContext,
|
||||
params = MobileWalletSetupFinishedComponent.Params(
|
||||
callbacks = model.mobileWalletSetupFinishedComponentModelCallbacks,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -16,4 +16,7 @@ internal sealed class UpdateAccessCodeRoute : Route {
|
|||
val userWalletId: UserWalletId,
|
||||
val accessCode: String,
|
||||
) : UpdateAccessCodeRoute()
|
||||
|
||||
@Serializable
|
||||
data object SetupFinished : UpdateAccessCodeRoute()
|
||||
}
|
||||
|
|
@ -176,7 +176,7 @@ internal class WalletActivationModel @Inject constructor(
|
|||
}
|
||||
|
||||
inner class MobileWalletSetupFinishedModelCallbacks : MobileWalletSetupFinishedComponent.ModelCallbacks {
|
||||
override fun onContinueClick() {
|
||||
override fun onFinishClick() {
|
||||
router.pop()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue