Updated on 2026-08-14
This commit is contained in:
parent
448b711db3
commit
e29d96be64
5 changed files with 28 additions and 36 deletions
|
|
@ -574,10 +574,12 @@
|
|||
<string name="hw_backup_need_action">Go to backup</string>
|
||||
<string name="hw_backup_need_description">Please back up your wallet before creating an access code.</string>
|
||||
<string name="hw_backup_need_title">Finalize backup first</string>
|
||||
<string name="hw_backup_need_finish_first">Finish backup first</string>
|
||||
<string name="hw_backup_no_backup">Incomplete</string>
|
||||
<string name="hw_backup_section_other_title">Other methods</string>
|
||||
<string name="hw_backup_seed_description">Physical devices that securely store your private key offline.</string>
|
||||
<string name="hw_backup_seed_title">Recovery phrase</string>
|
||||
<string name="hw_backup_to_secure_description">To secure your wallet with a Access Code, complete the backup first.</string>
|
||||
<string name="hw_backup_to_upgrade_description">To upgrade your wallet to hardware, back it up first.</string>
|
||||
<string name="hw_create_keys_description">Your private keys are securely encrypted and stored on your phone</string>
|
||||
<string name="hw_create_keys_title">Keys are stored in the app</string>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import com.tangem.core.decompose.model.ParamsContainer
|
|||
import com.tangem.core.decompose.navigation.Router
|
||||
import com.tangem.core.decompose.ui.UiMessageSender
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.message.DialogMessage
|
||||
import com.tangem.core.ui.message.EventMessageAction
|
||||
import com.tangem.core.ui.message.SnackbarMessage
|
||||
|
|
@ -69,21 +68,20 @@ internal class ForgetWalletModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun onForgetWalletClick() {
|
||||
// TODO actualize strings [REDACTED_TASK_KEY]
|
||||
uiMessageSender.send(
|
||||
DialogMessage(
|
||||
title = stringReference("Attention"),
|
||||
message = stringReference("Are you sure you want to do this?"),
|
||||
title = resourceReference(R.string.common_attention),
|
||||
message = resourceReference(R.string.hw_remove_wallet_confirmation_title),
|
||||
firstActionBuilder = {
|
||||
EventMessageAction(
|
||||
title = stringReference("Forget"),
|
||||
title = resourceReference(R.string.common_forget),
|
||||
isWarning = true,
|
||||
onClick = ::forgetWallet,
|
||||
)
|
||||
},
|
||||
secondActionBuilder = {
|
||||
EventMessageAction(
|
||||
title = stringReference("Cancel"),
|
||||
title = resourceReference(R.string.common_cancel),
|
||||
onClick = {},
|
||||
)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.tangem.core.ui.components.PrimaryButton
|
|||
import com.tangem.core.ui.components.appbar.TangemTopAppBar
|
||||
import com.tangem.core.ui.components.appbar.models.TopAppBarButtonUM
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.stringResourceSafe
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.features.hotwallet.forgetwallet.entity.ForgetWalletUM
|
||||
|
|
@ -26,7 +27,6 @@ import com.tangem.features.hotwallet.forgetwallet.entity.ForgetWalletUM
|
|||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
internal fun ForgetWalletContent(state: ForgetWalletUM, modifier: Modifier = Modifier) {
|
||||
// TODO actualize strings [REDACTED_TASK_KEY]
|
||||
Column(
|
||||
modifier = modifier
|
||||
.background(TangemTheme.colors.background.primary)
|
||||
|
|
@ -53,14 +53,14 @@ internal fun ForgetWalletContent(state: ForgetWalletUM, modifier: Modifier = Mod
|
|||
)
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
Text(
|
||||
text = "Attention",
|
||||
text = stringResourceSafe(R.string.common_attention),
|
||||
style = TangemTheme.typography.h2,
|
||||
color = TangemTheme.colors.text.primary1,
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
Text(
|
||||
text = "This wallet will be permanently removed from your device",
|
||||
text = stringResourceSafe(R.string.hw_remove_wallet_attention_description),
|
||||
style = TangemTheme.typography.body1,
|
||||
color = TangemTheme.colors.text.secondary,
|
||||
textAlign = TextAlign.Center,
|
||||
|
|
@ -72,21 +72,21 @@ internal fun ForgetWalletContent(state: ForgetWalletUM, modifier: Modifier = Mod
|
|||
modifier = Modifier.padding(horizontal = 16.dp),
|
||||
checked = state.firstCheckboxChecked,
|
||||
onCheckedChange = state.onFirstCheckboxClick,
|
||||
text = "I understand that removing my wallet does not delete it—but simply removes it from my device.",
|
||||
text = stringResourceSafe(R.string.hw_remove_wallet_warning_device),
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
CheckboxItem(
|
||||
modifier = Modifier.padding(horizontal = 16.dp),
|
||||
checked = state.secondCheckboxChecked,
|
||||
onCheckedChange = state.onSecondCheckboxClick,
|
||||
text = "I understand that if I haven't backed up my wallet before removing it, I may lose access to it.",
|
||||
text = stringResourceSafe(R.string.hw_remove_wallet_warning_access),
|
||||
)
|
||||
Spacer(modifier = Modifier.height(32.dp))
|
||||
PrimaryButton(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(16.dp),
|
||||
text = "Forget wallet",
|
||||
text = stringResourceSafe(R.string.hw_remove_wallet_action_forget_title),
|
||||
onClick = state.onForgetWalletClick,
|
||||
enabled = state.isForgetButtonEnabled,
|
||||
)
|
||||
|
|
@ -95,7 +95,6 @@ internal fun ForgetWalletContent(state: ForgetWalletUM, modifier: Modifier = Mod
|
|||
|
||||
@Composable
|
||||
private fun CheckboxItem(checked: Boolean, onCheckedChange: () -> Unit, text: String, modifier: Modifier = Modifier) {
|
||||
// TODO actualize strings [REDACTED_TASK_KEY]
|
||||
Row(
|
||||
modifier = modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.Start,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import com.tangem.core.ui.components.bottomsheets.message.primaryButton
|
|||
import com.tangem.core.ui.components.label.entity.LabelStyle
|
||||
import com.tangem.core.ui.components.label.entity.LabelUM
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.message.bottomSheetMessage
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.wallets.usecase.GenerateBuyTangemCardLinkUseCase
|
||||
|
|
@ -51,7 +50,6 @@ internal class WalletHardwareBackupModel @Inject constructor(
|
|||
|
||||
private val params = paramsContainer.require<WalletHardwareBackupComponent.Params>()
|
||||
|
||||
// TODO actualize strings [REDACTED_TASK_KEY]
|
||||
private val makeBackupAtFirstAlertBS
|
||||
get() = bottomSheetMessage {
|
||||
infoBlock {
|
||||
|
|
@ -59,8 +57,8 @@ internal class WalletHardwareBackupModel @Inject constructor(
|
|||
type = MessageBottomSheetUMV2.Icon.Type.Accent
|
||||
backgroundType = MessageBottomSheetUMV2.Icon.BackgroundType.SameAsTint
|
||||
}
|
||||
title = stringReference("Finish Backup First")
|
||||
body = stringReference("To upgrade your wallet to hardware, back it up first.")
|
||||
title = resourceReference(R.string.hw_backup_need_finish_first)
|
||||
body = resourceReference(R.string.hw_backup_to_upgrade_description)
|
||||
}
|
||||
primaryButton {
|
||||
text = resourceReference(R.string.hw_backup_need_action)
|
||||
|
|
@ -76,27 +74,24 @@ internal class WalletHardwareBackupModel @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
// TODO actualize strings [REDACTED_TASK_KEY]
|
||||
internal val uiState: StateFlow<WalletHardwareBackupUM>
|
||||
field = MutableStateFlow(
|
||||
WalletHardwareBackupUM(
|
||||
onBackClick = { router.pop() },
|
||||
blocks = persistentListOf(
|
||||
WalletHardwareBackupUM.Block(
|
||||
title = stringReference("Create new wallet"),
|
||||
title = resourceReference(R.string.hw_backup_hardware_create_title),
|
||||
titleLabel = LabelUM(
|
||||
text = resourceReference(R.string.common_recommended),
|
||||
style = LabelStyle.ACCENT,
|
||||
),
|
||||
description = stringReference(
|
||||
"Create a new secure wallet and transfer your funds for extra protection.",
|
||||
),
|
||||
description = resourceReference(R.string.hw_backup_hardware_create_description),
|
||||
onClick = ::onCreateNewWalletClick,
|
||||
),
|
||||
WalletHardwareBackupUM.Block(
|
||||
title = stringReference("Upgrade current wallet"),
|
||||
title = resourceReference(R.string.hw_backup_hardware_upgrade_title),
|
||||
titleLabel = null,
|
||||
description = stringReference("Move your current wallet into Tangem Wallet."),
|
||||
description = resourceReference(R.string.hw_backup_hardware_upgrade_description),
|
||||
onClick = ::onUpgradeCurrentWalletClick,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import com.tangem.core.decompose.ui.UiMessageSender
|
|||
import com.tangem.core.navigation.settings.SettingsManager
|
||||
import com.tangem.core.ui.components.bottomsheets.message.*
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.message.DialogMessage
|
||||
import com.tangem.core.ui.message.EventMessageAction
|
||||
import com.tangem.core.ui.message.SnackbarMessage
|
||||
|
|
@ -385,8 +384,8 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
type = MessageBottomSheetUMV2.Icon.Type.Accent
|
||||
backgroundType = MessageBottomSheetUMV2.Icon.BackgroundType.SameAsTint
|
||||
}
|
||||
title = resourceReference(R.string.hw_backup_need_title)
|
||||
body = resourceReference(R.string.hw_backup_need_description)
|
||||
title = resourceReference(R.string.hw_backup_need_finish_first)
|
||||
body = resourceReference(R.string.hw_backup_to_secure_description)
|
||||
}
|
||||
primaryButton {
|
||||
text = resourceReference(R.string.hw_backup_need_action)
|
||||
|
|
@ -442,8 +441,7 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
// TODO() Implement saving the new order of accounts
|
||||
}
|
||||
|
||||
// TODO actualize strings [REDACTED_TASK_KEY] and remove MaximumLineLength
|
||||
@Suppress("LongMethod", "MaximumLineLength")
|
||||
@Suppress("LongMethod")
|
||||
private fun onForgetWalletClick(userWallet: UserWallet) {
|
||||
val message = when (userWallet) {
|
||||
is UserWallet.Cold -> {
|
||||
|
|
@ -468,16 +466,16 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
type = MessageBottomSheetUMV2.Icon.Type.Warning
|
||||
backgroundType = MessageBottomSheetUMV2.Icon.BackgroundType.SameAsTint
|
||||
}
|
||||
title = stringReference("Forget this wallet?")
|
||||
title = resourceReference(R.string.hw_remove_wallet_notification_title)
|
||||
body = if (userWallet.backedUp) {
|
||||
stringReference("A backup for this wallet exists. Review it before forgetting to make sure you can recover later.")
|
||||
resourceReference(R.string.hw_remove_wallet_notification_description_has_backup)
|
||||
} else {
|
||||
stringReference("If you forget this wallet without a backup, you’ll permanently lose access to your funds.")
|
||||
resourceReference(R.string.hw_remove_wallet_notification_description_without_backup)
|
||||
}
|
||||
}
|
||||
if (userWallet.backedUp) {
|
||||
secondaryButton {
|
||||
text = stringReference("Forget wallet")
|
||||
text = resourceReference(R.string.hw_remove_wallet_notification_action_forget)
|
||||
onClick {
|
||||
router.push(AppRoute.ForgetWallet(userWallet.walletId))
|
||||
closeBs()
|
||||
|
|
@ -485,7 +483,7 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
}
|
||||
} else {
|
||||
secondaryButton {
|
||||
text = stringReference("Forget Anyway")
|
||||
text = resourceReference(R.string.hw_remove_wallet_notification_action_forget_anyway)
|
||||
onClick {
|
||||
router.push(AppRoute.ForgetWallet(userWallet.walletId))
|
||||
closeBs()
|
||||
|
|
@ -494,7 +492,7 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
}
|
||||
if (userWallet.backedUp) {
|
||||
primaryButton {
|
||||
text = stringReference("View backup")
|
||||
text = resourceReference(R.string.hw_remove_wallet_notification_action_backup_view)
|
||||
onClick {
|
||||
unlockWalletIfNeedAndProceed {
|
||||
router.push(AppRoute.ViewPhrase(userWallet.walletId))
|
||||
|
|
@ -504,7 +502,7 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
}
|
||||
} else {
|
||||
primaryButton {
|
||||
text = stringReference("Go to backup")
|
||||
text = resourceReference(R.string.hw_remove_wallet_notification_action_backup_go)
|
||||
onClick {
|
||||
router.push(
|
||||
AppRoute.CreateWalletBackup(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue