Updated on 2026-08-14

This commit is contained in:
Tangem 2025-02-07 09:30:11 +04:00
parent 7c4c1e82a1
commit 26d255c390
26 changed files with 12 additions and 220 deletions

View file

@ -73,15 +73,8 @@ internal class MultiWalletAccessCodeModel @Inject constructor(
onAccessCodeFirstChange = ::onAccessCodeFirstChange,
onAccessCodeSecondChange = ::onAccessCodeSecondChange,
onContinue = ::onContinue,
onAccessCodeHideClick = ::onAccessCodeHideClick,
)
private fun onAccessCodeHideClick() {
_uiState.update {
it.copy(accessCodeHidden = !it.accessCodeHidden)
}
}
private fun onAccessCodeFirstChange(textFieldValue: TextFieldValue) {
_uiState.update {
it.copy(

View file

@ -21,10 +21,7 @@ internal fun MultiWalletAccessCodeBS(
state: MultiWalletAccessCodeUM,
onBack: () -> Unit,
) {
TangemBottomSheet<TangemBottomSheetConfigContent.Empty>(
config = config,
onBack = onBack,
) { _ ->
TangemBottomSheet<TangemBottomSheetConfigContent.Empty>(config = config, onBack = onBack) { _ ->
Content(state)
}
}

View file

@ -13,10 +13,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.tangem.core.ui.components.OutlineTextFieldWithIcon
import com.tangem.core.ui.components.OutlineTextField
import com.tangem.core.ui.extensions.stringResourceSafe
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemThemePreview
@ -57,17 +56,10 @@ internal fun MultiWalletAccessCodeEnter(
val focusRequester = remember { FocusRequester() }
OutlineTextFieldWithIcon(
OutlineTextField(
modifier = modifier
.focusRequester(focusRequester)
.fillMaxWidth(),
iconResId = if (state.accessCodeHidden) {
R.drawable.ic_eye_outline_24
} else {
R.drawable.ic_eye_off_outline_24
},
iconColor = TangemTheme.colors.icon.primary1,
onIconClick = state.onAccessCodeHideClick,
value = if (reEnterAccessCodeState) {
state.accessCodeSecond
} else {
@ -80,11 +72,7 @@ internal fun MultiWalletAccessCodeEnter(
},
label = stringResourceSafe(id = R.string.onboarding_wallet_info_title_third),
isError = state.codesNotMatchError || state.atLeast4CharError,
visualTransformation = if (state.accessCodeHidden) {
PasswordVisualTransformation()
} else {
VisualTransformation.None
},
visualTransformation = PasswordVisualTransformation(),
caption = when {
state.codesNotMatchError && reEnterAccessCodeState ->
stringResourceSafe(R.string.onboarding_access_codes_doesnt_match)

View file

@ -8,11 +8,9 @@ internal data class MultiWalletAccessCodeUM(
val accessCodeSecond: TextFieldValue = TextFieldValue(""),
val codesNotMatchError: Boolean = false,
val atLeast4CharError: Boolean = false,
val accessCodeHidden: Boolean = true,
val onAccessCodeFirstChange: (TextFieldValue) -> Unit = {},
val onAccessCodeSecondChange: (TextFieldValue) -> Unit = {},
val onContinue: () -> Unit = {},
val onAccessCodeHideClick: () -> Unit = {},
) {
enum class Step {
Intro,