diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml index 52aa5dfca4..857c2f4ff1 100644 --- a/core/res/src/main/res/values-ru/strings.xml +++ b/core/res/src/main/res/values-ru/strings.xml @@ -11,8 +11,9 @@ Не удалось отправить письмо Причина: %s Не могу отправить транзакцию + Выбранный кошелёк не поддерживает сеть %1$s Для активации криптографии сети %1$s необходимо сбросить кошелек до заводских настроек. Пожалуйста, выведите свои средства, чтобы не потерять их, после сброса доступ к текущему кошельку будет невозможен. - Токены в сети Solana не поддерживаются этой картой из-за ограничений прошивки. + Токены в сети %1$s не поддерживаются этой картой из-за ограничений прошивки. У вас возникли трудности со сканированием карты? Эта карта не предназначена для работы с этим приложением Перейдите в настройки, чтобы включить биометрическую аутентификацию в приложении Tangem @@ -57,10 +58,7 @@ Настройки карты Tangem Bot Чат - Оценить агента Отправить логи - Пожалуйста, выберите действие - Пожалуйста, оцените работу агента Принять Доступ запрещен Добавить @@ -89,12 +87,12 @@ Обменять Посмотреть историю транзакций Обозреватель - Скорость и комиссия Сетевые комиссии за транзакции используются для поддержки безопасности сети, поощрения валидаторов, выделения ресурсов и определения приоритета транзакции. - Медленно - По рынку - Быстро Свое + Быстро + По рынку + Медленно + Скорость и комиссия Сгенерировать адреса Импортировать Нравится @@ -144,7 +142,10 @@ Обязательное поле Количество знаков после запятой должно быть корректным числом не больше %d Своя деривация + Например m/00\'/0000\'/0\'/0/0 + Введите свою деривацию Знаков после запятой + Путь деривации По умолчанию Деривация по BIP44 Введенный путь деривации некорректен @@ -152,11 +153,15 @@ Название токена Не выбрано Сеть + Сеть + Вы можете добавить токен в ручную, если он не поддерживается Tangem Например, USDC Символ Символ токена Этот токен/сеть уже находится в вашем списке Токены могут быть созданы кем угодно. Остерегайтесь мошеннических токенов, они могут ничего не стоить + Остерегайтесь мошеннических токенов, они могут ничего не стоить + Токены могут быть созданы кем угодно Чат Код доступа Перед сканированием карты вам нужно будет ввести правильный код доступа. @@ -182,6 +187,13 @@ Вы использовали карту от другого кошелька. Приложите карту, связанную с этим кошельком. Вы получаете Вы отправляете + Мои токены + У вас нет добавленных токенов. Добавьте токены для обмена + Недоступен для обмена с %s + Провайдеры проводят транзакции, обеспечивая плавный и эффективный обмен токенами + Выберите провайдера + Лучший курс + Требуется разрешение Информация ниже не является обязательной. Вы можете стереть её, если хотите. Расскажите, каких функций вам не хватает, и мы постараемся вам помочь. Скажите, пожалуйста, какая у вас карта? @@ -238,7 +250,9 @@ Рыночная капитализация Выбранный токен не доступен в кошельке на данный момент. Но не переживайте, вы можете выразить свой интерес проголосовав за его добавление. Голосовать + Кошелек не поддерживает выбранную монету Выберите кошелек + Кошелёк не поддерживает более одной сети Вам необходимо установить единый код доступа для защиты всех ваших карт Защита Позже вы сможете установить индивидуальный код доступа для каждой карты @@ -392,50 +406,50 @@ Приготовьте свою карту Сумма Вычесть из суммы отправки - Сумма к получению %1$s + Сумма к получению %s + %1$s в %2$s Адрес Код назначения - %1$s в %2$s Введите адрес Адрес совпадает с адресом кошелька Недопустимый Tag. Он не будет добавлен в транзакцию. Недопустимый Memo. Он не будет добавлен в транзакцию. Tag Memo - Последние - Убедитесь, что вы отправляете средства на адрес кошелька %1$s. Ошибки могут привести к потере ваших токенов. - Мемо/Код назначения - это код, разделяющий транзакции к общему получателю в сети криптовалют. Внимание: отсутствие мемо может привести к потере средств. Включая комиссию Комиссия Низкая Нормальная Приоритетная + Лимит газа Цена газа Цена газа влияет на скорость транзакции. При сильно низкой, транзакция может быть не обработана. - Лимит газа - Максимальная сумма Всё + Максимальная сумма + Комиссия не превысит Максимальная cумма комиссии - Комиссия не превысит Сетевая комиссия - Покрытие сетевой комиссии Сумма отправки будет уменьшена для покрытия выбранного уровня комиссии - Обратите внимание, что при определенных параметрах комиссии возможны задержки по вашей транзакции + Покрытие сетевой комиссии + Недостаточно средств для перевода, так как сумма комиссии и сумма перевода в совокупности больше имеющегося баланса Недостаточно средств - Недостаточно средств для перевода, так как сумма комиссии и сумма перевода в совокупности больше имеющегося баланса. - Недопустимая сумма - Включенная комиссия превышает сумму перевода, что приводит к отрицательному значению. - Минимальная сумма отправки - %1$s. Пожалуйста, убедитесь, что остаток после отправки также не будет меньше %1$s. - Сумма резерва не может быть менее %1$s. - Пожалуйста, пополните свой баланс, чтобы продолжить. - Увеличение комиссии - Комиссия при переводе всего баланса выше. Для того, чтобы снизить комиссию Вы можете оставить 0.01. - Комиссия превышает баланс Размер комиссии превышает баланс сети. Для продолжения необходимо пополнить баланс сети. + Комиссия превышает баланс + Комиссия при переводе всего баланса выше. Для того, чтобы снизить комиссию Вы можете оставить 0.01. + Увеличение комиссии + Включенная комиссия превышает сумму перевода, что приводит к отрицательному значению + Недопустимая сумма + Минимальная сумма отправки - %1$s. Пожалуйста, убедитесь, что остаток после отправки также не будет меньше %1$s. + Пожалуйста, пополните свой баланс, чтобы продолжить + Сумма резерва не может быть менее %1$s + Обратите внимание, что при определенных параметрах комиссии возможны задержки по вашей транзакции Возможны задержки по транзакции Необязательное QR код содержит информацию о сумме отправки равной %s + Последние Получатель + Убедитесь, что вы отправляете средства на адрес кошелька %s. Ошибки могут привести к потере ваших токенов + Мемо/ Код назначения - это код, разделяющий транзакции к общему получателю в сети криптовалют. Внимание: отсутствие мемо может привести к потере средств. Мои кошельки Отправка %s Всего @@ -650,7 +664,7 @@ Сеть Solana взимает арендную плату в размере %1$s каждые 2 дня. Аккаунты, которые не могут позволить себе арендную плату, удаляются из сети. Пополните свой счет более чем на %2$s, чтобы не платить арендную плату. Некоторые сети в настоящее время недоступны. Пожалуйста, повторите попытку позже. Некоторые сети недоступны - Это Testnet карта. Она не может обрабатывать транзакции и используется только в целях тестирования и разработки. + Это Testnet карта. Он не может обрабатывать транзакции и используется только в целях тестирования и разработки. Только для целей тестирования Отказаться Вы не закончили резервное копирование. Хотите продолжить? diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 09f3ec83d1..b26afb1dea 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -11,8 +11,9 @@ Failed to send the email Reason: %s Can\'t send a transaction + The selected does not support the %1$s network To activate the %1$s blockchain\'s cryptographic encryption, you\'ll need to reset the wallet to factory settings. Please withdraw your funds before doing so to ensure that you don\'t lose them, and then complete the reset process. Access to the current wallet will not be possible after the reset. - Tokens in Solana network are not supported by this card due to firmware limitation. + Tokens in %1$s network are not supported by this card due to firmware limitation. Are you having difficulty scanning your card? This card is not designed to work with this app Go to settings to enable biometric authentication in the Tangem App @@ -55,10 +56,7 @@ Card Settings Tangem Bot Support - Rate agent Send logs - Please select an action - Please, rate the work of the agent Accept Access denied Add @@ -85,15 +83,15 @@ Enabled Error Exchange - Explore transaction history Explore + Explore transaction history Explorer - Speed and fee - Network transaction fees are used to support network security, incentivize validators, allocate resources, and determine transaction priority - Slow - Market - Fast + Network transaction fees are used to support network security, incentivize validators, allocate resources, and determine transaction priority. Custom + Fast + Market + Slow + Speed and fee Generate addresses Import Learn & Earn @@ -162,6 +160,8 @@ Token symbol This token/network has already been added to your list Note that tokens can be created by anyone. Be aware of adding scam tokens, they can cost nothing. + Be aware of adding scam tokens, they can cost nothing + Note that tokens can be created by anyone Chat Access code You will have to submit the correct access code before scanning the card @@ -187,6 +187,13 @@ You have used a card from another wallet. Tap the card associated with this wallet You Receive You Send + My tokens + You don\'t have any added tokens yet. Add tokens via Market to swap + Unavailable for swap from %s + Providers facilitate transactions, ensuring smooth and efficient token exchanges + Choose Provider + Best Rate + Permission Needed The following information is optional. You can erase it if you don\'t want to share it. Tell us what functions you are missing, and we will try to help you. Please tell us what card do you have @@ -224,6 +231,8 @@ Tokens Add Edit + Couldn’t find this token, you can add it manually + Coin market cap Blockchain the cryptocurrency was initially created Native network Using non-native networks for tokens enables cross-blockchain interoperability, allowing assets to be utilized in diverse decentralized applications and smart contracts across platforms. However, this often involves a custodian or smart contract to hold the original asset securely, introducing centralization and counterparty risk. @@ -242,7 +251,9 @@ Coin market cap The selected token is currently unavailable for actions within the crypto wallet. But worry not, you can express your interest by upvoting it. Upvote + Wallet Incompatible with selected Coin Choose wallet + The wallet doesn\'t support more than one network You have to set up a single access code to protect all your wallets Protect You can set up an individual access code on each card later @@ -392,10 +403,10 @@ Get your card ready! Amount Subtract from send amount - The recipient will receive %1$s + The recipient will receive %s + %1$s at %2$s Address Destination Tag - %1$s at %2$s Enter address Address is the same as wallet address Invalid Tag. It won\'t be added to the transaction. @@ -408,47 +419,47 @@ Low Normal Priority - Network fee info unreachable Check your network connection + Network fee info unreachable + From **%s** Gas limit Gas Limit is auto-calculated; raise it during network congestion Gas price - Gas Price affects transaction speed. If it\'s too low, the transaction might not be processed. - Maximum amount + Gas Price affects transaction speed. If it\'s too low, the transaction might not be processed Max - Maximum fee amount + Maximum amount Max fee + Maximum fee amount Numbers only for Destination Tag Network fee - Network fee coverage Sending amount will be reduced to cover the selected fee level - Kindly be aware that your transaction may experience delays under specific fee settings + Network fee coverage + Insufficient funds for the transfer, as the total of the fee and transfer amount exceeds the existing balance Total exceeds balance - Insufficient funds for the transfer, as the total of the fee and transfer amount exceeds the existing balance. - Invalid amount - The included commission exceeds the transfer amount, leading to a negative value. - The minimum sending amount is %1$s. Please ensure that the remaining balance after sending will not be less than %1$s. - The balance amount must be at least %1$s. - Please top up your balance to continue. - Fee is increased - The fee for transferring the entire balance is higher. To reduce the commission, you can leave 0.01. - Fee exceeds balance The commission fee exceeds the network balance. To continue, it is necessary to replenish the network balance. + Fee exceeds balance + The fee for transferring the entire balance is higher. To reduce the commission, you can leave 0.01. + Fee is increased + The included commission exceeds the transfer amount, leading to a negative value + Invalid amount + The minimum sending amount is %1$s. Please ensure that the remaining balance after sending will not be less than %1$s. + Please top up your balance to continue + The balance amount must be at least %1$s + Kindly be aware that your transaction may experience delays under specific fee settings Transaction delays are possible Optional - Please align your QR code with the square to scan it. Ensure you scan %s network address. - Recipient’s address scanned - Sending amount was changed - QR code contains information about the sending amount equal to %s - Change the entered amount? Change Decline + Recipient’s address scanned + Change the entered amount? + QR code contains information about the sending amount equal to %s + Please align your QR code with the square to scan it. Ensure you scan %s network address. Recent Recipient Not a valid address + Ensure that you are sending funds to an %s wallet address. Errors may result in the loss of your tokens + A Memo/Destination Tag is a unique ID for differentiating transactions sent to the same recipient on the same network. Caution: Omitting a memo may lead to misplaced funds My wallets - Ensure that you are sending funds to an %1$s wallet address. Errors may result in the loss of your tokens. - A Memo/Destination Tag is a unique ID for differentiating transactions sent to the same recipient on the same network. Caution: Omitting a memo may lead to misplaced funds. Sending %s Total %1$s and %2$s will be sent @@ -456,6 +467,7 @@ %s will be sent Transaction has been successfully signed and sent to the blockchain node. Wallet balance will be updated in a while Invalid address + Transaction sent Buy now I have a promo code… Tangem Wallet diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/buttons/common/TangemButton.kt b/core/ui/src/main/java/com/tangem/core/ui/components/buttons/common/TangemButton.kt index 8ce113a33f..ae762b2803 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/buttons/common/TangemButton.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/buttons/common/TangemButton.kt @@ -4,6 +4,7 @@ import androidx.compose.foundation.layout.* import androidx.compose.material.* import androidx.compose.runtime.Composable import androidx.compose.runtime.ReadOnlyComposable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.composed import androidx.compose.ui.graphics.Shape @@ -108,7 +109,7 @@ private inline fun RowScope.ButtonContentContainer( if (showProgress) { progressIndicator() } else { - Column { + Column(horizontalAlignment = Alignment.CenterHorizontally) { Row(horizontalArrangement = Arrangement.Center) { if (buttonIcon is TangemButtonIconPosition.Start) { icon(buttonIcon.iconResId) diff --git a/core/ui/src/main/java/com/tangem/core/ui/res/TangemDimens.kt b/core/ui/src/main/java/com/tangem/core/ui/res/TangemDimens.kt index cb2f374b0c..2fc319885d 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/res/TangemDimens.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/res/TangemDimens.kt @@ -55,6 +55,7 @@ data class TangemDimens internal constructor( val size20: Dp = 20.dp, val size24: Dp = 24.dp, val size28: Dp = 28.dp, + val size30: Dp = 30.dp, val size32: Dp = 32.dp, val size34: Dp = 34.dp, val size36: Dp = 36.dp, diff --git a/features/manage-tokens/impl/src/main/java/com/tangem/managetokens/presentation/common/state/AlertState.kt b/features/manage-tokens/impl/src/main/java/com/tangem/managetokens/presentation/common/state/AlertState.kt new file mode 100644 index 0000000000..767427f16d --- /dev/null +++ b/features/manage-tokens/impl/src/main/java/com/tangem/managetokens/presentation/common/state/AlertState.kt @@ -0,0 +1,42 @@ +package com.tangem.managetokens.presentation.common.state + +import com.tangem.core.ui.extensions.TextReference +import com.tangem.core.ui.extensions.resourceReference +import com.tangem.core.ui.extensions.wrappedList +import com.tangem.features.managetokens.impl.R + +internal sealed class AlertState { + + abstract val message: TextReference + + class DefaultAlert( + override val message: TextReference, + ) : AlertState() + + class TokenUnavailable( + val onUpvoteClick: () -> Unit, + ) : AlertState() { + override val message: TextReference = resourceReference(R.string.manage_tokens_unavailable_description) + val confirmButtonText: TextReference = resourceReference(R.string.common_close) + val dismissButtonText: TextReference = resourceReference(R.string.manage_tokens_unavailable_vote) + } + + object NonNative : AlertState() { + override val message: TextReference = resourceReference(R.string.manage_tokens_network_selector_non_native_info) + } + + object TokensUnsupported : AlertState() { + override val message: TextReference = resourceReference(R.string.alert_manage_tokens_unsupported_message) + } + + object TokensUnsupportedCurve : AlertState() { + override val message: TextReference = resourceReference(R.string.alert_manage_tokens_unsupported_curve_message) + } + + class TokensUnsupportedBlockchainByCard(val token: String) : AlertState() { + override val message: TextReference = resourceReference( + id = R.string.alert_manage_tokens_unsupported_blockchain_by_card_message, + formatArgs = wrappedList(token), + ) + } +} \ No newline at end of file diff --git a/features/manage-tokens/impl/src/main/java/com/tangem/managetokens/presentation/common/state/Event.kt b/features/manage-tokens/impl/src/main/java/com/tangem/managetokens/presentation/common/state/Event.kt new file mode 100644 index 0000000000..4024d7a4d8 --- /dev/null +++ b/features/manage-tokens/impl/src/main/java/com/tangem/managetokens/presentation/common/state/Event.kt @@ -0,0 +1,8 @@ +package com.tangem.managetokens.presentation.common.state + +import androidx.compose.runtime.Immutable + +@Immutable +internal sealed interface Event { + data class ShowAlert(val state: AlertState) : Event +} \ No newline at end of file diff --git a/features/manage-tokens/impl/src/main/java/com/tangem/managetokens/presentation/common/ui/EventEffect.kt b/features/manage-tokens/impl/src/main/java/com/tangem/managetokens/presentation/common/ui/EventEffect.kt new file mode 100644 index 0000000000..0bfc404f35 --- /dev/null +++ b/features/manage-tokens/impl/src/main/java/com/tangem/managetokens/presentation/common/ui/EventEffect.kt @@ -0,0 +1,18 @@ +package com.tangem.managetokens.presentation.common.ui + +import androidx.compose.runtime.Composable +import com.tangem.core.ui.event.StateEvent +import com.tangem.managetokens.presentation.common.state.AlertState +import com.tangem.managetokens.presentation.common.state.Event + +@Composable +internal fun EventEffect(event: StateEvent, onAlertStateSet: (AlertState) -> Unit) { + com.tangem.core.ui.event.EventEffect( + event = event, + onTrigger = { value -> + when (value) { + is Event.ShowAlert -> onAlertStateSet(value.state) + } + }, + ) +} \ No newline at end of file diff --git a/features/manage-tokens/impl/src/main/java/com/tangem/managetokens/presentation/common/ui/components/Alert.kt b/features/manage-tokens/impl/src/main/java/com/tangem/managetokens/presentation/common/ui/components/Alert.kt new file mode 100644 index 0000000000..27b83aca6b --- /dev/null +++ b/features/manage-tokens/impl/src/main/java/com/tangem/managetokens/presentation/common/ui/components/Alert.kt @@ -0,0 +1,50 @@ +package com.tangem.managetokens.presentation.common.ui.components + +import androidx.compose.runtime.Composable +import androidx.compose.ui.res.stringResource +import com.tangem.core.ui.components.BasicDialog +import com.tangem.core.ui.components.DialogButton +import com.tangem.core.ui.extensions.resolveReference +import com.tangem.features.managetokens.impl.R +import com.tangem.managetokens.presentation.common.state.AlertState + +@Composable +internal fun Alert(state: AlertState, onDismiss: () -> Unit) { + when (state) { + is AlertState.DefaultAlert, + is AlertState.NonNative, + AlertState.TokensUnsupportedCurve, + AlertState.TokensUnsupported, + is AlertState.TokensUnsupportedBlockchainByCard, + -> DefaultAlert(state, onDismiss) + is AlertState.TokenUnavailable -> TokenUnavailableAlert(state, onDismiss) + } +} + +@Composable +private fun DefaultAlert(state: AlertState, onDismiss: () -> Unit) { + BasicDialog( + message = state.message.resolveReference(), + confirmButton = DialogButton( + title = stringResource(id = R.string.common_ok), + onClick = onDismiss, + ), + onDismissDialog = onDismiss, + ) +} + +@Composable +private fun TokenUnavailableAlert(state: AlertState.TokenUnavailable, onDismiss: () -> Unit) { + BasicDialog( + message = state.message.resolveReference(), + confirmButton = DialogButton( + title = state.confirmButtonText.resolveReference(), + onClick = onDismiss, + ), + dismissButton = DialogButton( + title = state.dismissButtonText.resolveReference(), + onClick = { state.onUpvoteClick() }, + ), + onDismissDialog = onDismiss, + ) +} \ No newline at end of file