Updated on 2026-08-14

This commit is contained in:
Tangem 2025-08-15 19:19:39 +05:00
commit db40956307
21 changed files with 30 additions and 11 deletions

View file

@ -60,6 +60,7 @@ class AmountStateConverter(
return AmountState.Data(
title = value.title,
availableBalance = resourceReference(R.string.common_crypto_fiat_format, wrappedList(crypto, fiat)),
availableBalanceShort = stringReference(crypto),
tokenName = stringReference(status.currency.name),
tokenIconState = iconStateConverter.convert(status),
amountTextField = amountFieldConverter.convert(value.value),
@ -130,6 +131,7 @@ class AmountStateConverterV2(
} else {
resourceReference(R.string.common_crypto_fiat_format, wrappedList(crypto, fiat))
},
availableBalanceShort = stringReference(crypto),
tokenName = stringReference(cryptoCurrencyStatus.currency.name),
tokenIconState = iconStateConverter.convert(cryptoCurrencyStatus.currency),
amountTextField = amountFieldConverter.convert(value.value),

View file

@ -48,6 +48,7 @@ class AmountBoundaryUpdateTransformer(
return prevState.copy(
availableBalance = availableBalance,
availableBalanceShort = stringReference(crypto),
)
}
}

View file

@ -17,7 +17,8 @@ sealed class AmountState {
/**
* @param isPrimaryButtonEnabled indicates if next state button enabled
* @param title title
* @param availableBalance user crypto currency balance
* @param availableBalance user crypto currency balance with fiat balance
* @param availableBalanceShort user crypto currency balance without fiat balance
* @param tokenIconState crypto currency icon state
* @param segmentedButtonConfig currency switcher config
* @param selectedButton selected currency index
@ -33,6 +34,7 @@ sealed class AmountState {
override val isRedesignEnabled: Boolean,
val title: TextReference,
val availableBalance: TextReference,
val availableBalanceShort: TextReference,
val tokenName: TextReference,
val tokenIconState: CurrencyIconState,
val segmentedButtonConfig: PersistentList<AmountSegmentedButtonsConfig>,

View file

@ -24,7 +24,8 @@ object AmountStatePreviewData {
val amountState = AmountState.Data(
isPrimaryButtonEnabled = false,
title = stringReference("Family Wallet"),
availableBalance = stringReference("2 130,88 USDT (2 129,92 \$)"),
availableBalance = stringReference("2 130,88 USDT • 2 129,92 \$)"),
availableBalanceShort = stringReference("2 130,88 USDT"),
tokenIconState = CurrencyIconState.Loading,
segmentedButtonConfig = persistentListOf(
AmountSegmentedButtonsConfig(

View file

@ -64,7 +64,7 @@ fun AmountBlockV2(
AmountBlockV2(
title = amountState.title,
balance = amountState.availableBalance,
balance = amountState.availableBalanceShort,
currencyTitle = currencyTitle,
currencyIconState = amountState.tokenIconState,
firstAmount = firstAmount,

View file

@ -118,6 +118,7 @@
<string name="common_access_denied">Zugang verweigert</string>
<string name="common_add_to_portfolio">Zum Portfolio hinzufügen</string>
<string name="common_add_token">Token hinzufügen</string>
<string name="common_address">Vertragsadresse</string>
<string name="common_all">Alle</string>
<string name="common_allow">Erlauben</string>
<string name="common_amount">Betrag</string>

View file

@ -115,6 +115,7 @@
<string name="common_access_denied">Acceso denegado</string>
<string name="common_add_to_portfolio">Añadir al portafolio</string>
<string name="common_add_token">Agregar token</string>
<string name="common_address">Dirección</string>
<string name="common_all">Todos</string>
<string name="common_allow">Autorizar</string>
<string name="common_amount">Montante</string>

View file

@ -97,6 +97,7 @@
<string name="common_access_denied">Accès refusé</string>
<string name="common_add_to_portfolio">Ajouter au portfolio</string>
<string name="common_add_token">Ajouter un jeton</string>
<string name="common_address">Adresse</string>
<string name="common_all">Tous</string>
<string name="common_allow">Permettre</string>
<string name="common_amount">Montant</string>

View file

@ -146,6 +146,7 @@
<string name="common_access_denied">アクセスが拒否されました</string>
<string name="common_add_to_portfolio">ポートフォリオに追加</string>
<string name="common_add_token">トークンを追加</string>
<string name="common_address">アドレス</string>
<string name="common_all">すべて</string>
<string name="common_allow">許可する</string>
<string name="common_amount">金額</string>

View file

@ -94,6 +94,7 @@
<string name="common_access_denied">Доступ запрещен</string>
<string name="common_add_to_portfolio">Добавить в портфель</string>
<string name="common_add_token">Добавить токен</string>
<string name="common_address">Адрес</string>
<string name="common_all">Все</string>
<string name="common_allow">Разрешить</string>
<string name="common_amount">Сумма</string>

View file

@ -94,6 +94,7 @@
<string name="common_access_denied">Доступ заборонено</string>
<string name="common_add_to_portfolio">Додати у портфель</string>
<string name="common_add_token">Додати токен</string>
<string name="common_address">Адреса</string>
<string name="common_all">Усе</string>
<string name="common_allow">Дозволити</string>
<string name="common_amount">Сума</string>

View file

@ -152,6 +152,7 @@
<string name="common_access_denied">Access denied</string>
<string name="common_add_to_portfolio">Add to portfolio</string>
<string name="common_add_token">Add token</string>
<string name="common_address">Address</string>
<string name="common_all">All</string>
<string name="common_allow">Allow</string>
<string name="common_amount">Amount</string>
@ -1002,6 +1003,8 @@
<string name="send_with_swap_confirm_title">Swap and send</string>
<string name="send_with_swap_convert_token_alert_message">Proceed with conversion? This will clear your previous data.</string>
<string name="send_with_swap_convert_token_alert_title">Confirm Conversion</string>
<string name="send_with_swap_correct_recipient_network_notification_message">Sending any other currency will result in its irreversible loss.</string>
<string name="send_with_swap_correct_recipient_network_notification_title">Select the correct recipient network</string>
<string name="send_with_swap_notification_text">Send any token, and well convert it on the way. Your recipient gets exactly what they need—seamlessly.</string>
<string name="send_with_swap_recipient_amount_success_title">Recipient will receive</string>
<string name="send_with_swap_recipient_amount_text">To recipient</string>

View file

@ -156,7 +156,7 @@ internal class DefaultSendComponent @AssistedInject constructor(
currentRoute = model.currentRoute.filterIsInstance<CommonSendRoute.Destination>(),
isBalanceHidingFlow = model.isBalanceHiddenFlow,
analyticsCategoryName = model.analyticCategoryName,
title = resourceReference(R.string.send_recipient_label),
title = resourceReference(R.string.common_address),
userWalletId = params.userWalletId,
cryptoCurrency = params.currency,
callback = model,

View file

@ -10,4 +10,7 @@ internal enum class EnterAddressSource {
val isPasted: Boolean
get() = this != InputField
val isAutoNext: Boolean
get() = this == RecentAddress || this == MyWallets
}

View file

@ -286,8 +286,7 @@ internal class SendDestinationModel @Inject constructor(
}
private fun autoNextFromRecipient(type: EnterAddressSource?, isValidAddress: Boolean, isValidMemo: Boolean) {
val isRecent = type == EnterAddressSource.RecentAddress
if (isRecent && isValidAddress && isValidMemo) {
if (type?.isAutoNext == true && isValidAddress && isValidMemo) {
saveResult()
(params as? SendDestinationComponentParams.DestinationParams)?.callback?.onNextClick()
}

View file

@ -205,6 +205,7 @@ class SendConfirmationNotificationsTransformerTest {
isRedesignEnabled = false,
title = mockk(relaxed = true),
availableBalance = mockk(relaxed = true),
availableBalanceShort = mockk(relaxed = true),
tokenName = mockk(relaxed = true),
tokenIconState = mockk(relaxed = true),
segmentedButtonConfig = persistentListOf(),

View file

@ -204,6 +204,7 @@ class SendConfirmationNotificationsTransformerV2Test {
isRedesignEnabled = false,
title = mockk(relaxed = true),
availableBalance = mockk(relaxed = true),
availableBalanceShort = mockk(relaxed = true),
tokenName = mockk(relaxed = true),
tokenIconState = mockk(relaxed = true),
segmentedButtonConfig = persistentListOf(),

View file

@ -307,6 +307,7 @@ class TransformersComparisonTest {
isRedesignEnabled = false,
title = mockk(relaxed = true),
availableBalance = mockk(relaxed = true),
availableBalanceShort = mockk(relaxed = true),
tokenName = mockk(relaxed = true),
tokenIconState = mockk(relaxed = true),
segmentedButtonConfig = persistentListOf(),

View file

@ -72,14 +72,13 @@ internal fun SwapAmountBlockContent(
start.linkTo(parent.start)
end.linkTo(parent.end)
},
extraContent = {
SwapPriceImpact(amountFieldUM = amountUM.primaryAmount, onInfoClick = onInfoClick)
},
extraContent = { SwapPriceImpact(amountFieldUM = amountUM.primaryAmount, onInfoClick = onInfoClick) },
)
AmountBlockV2(
amountState = (amountUM.secondaryAmount.amountField as? AmountState.Data)?.copy(
title = resourceReference(R.string.send_with_swap_recipient_amount_title),
availableBalance = TextReference.EMPTY,
availableBalanceShort = TextReference.EMPTY,
) ?: amountUM.secondaryAmount.amountField,
isClickDisabled = true,
isEditingDisabled = false,

View file

@ -160,7 +160,7 @@ internal class DefaultSendWithSwapComponent @AssistedInject constructor(
currentRoute = model.currentRoute.filterIsInstance<DestinationRoute>(),
isBalanceHidingFlow = model.isBalanceHiddenFlow,
analyticsCategoryName = model.analyticCategoryName,
title = resourceReference(R.string.send_recipient_label),
title = resourceReference(R.string.common_address),
userWalletId = params.userWalletId,
cryptoCurrency = secondaryCryptoCurrency,
callback = model,

View file

@ -30,7 +30,7 @@ internal fun WcAddressItem(address: String, modifier: Modifier = Modifier) {
)
Text(
modifier = Modifier.padding(start = TangemTheme.dimens.spacing8),
text = stringResourceSafe(R.string.wc_common_address),
text = stringResourceSafe(R.string.common_address),
style = TangemTheme.typography.body1,
color = TangemTheme.colors.text.primary1,
maxLines = 1,