diff --git a/core/res/src/main/res/values-de/strings.xml b/core/res/src/main/res/values-de/strings.xml index 47e0920719..aa10a37bfa 100644 --- a/core/res/src/main/res/values-de/strings.xml +++ b/core/res/src/main/res/values-de/strings.xml @@ -126,6 +126,7 @@ Genehmigung Genehmigen Achtung + Verfügbare Netzwerke Sicherungskopie Bilanz: %s Saldo @@ -140,6 +141,7 @@ Aktion wählen Netzwerk auswählen Token auswählen + Wallet auswählen Beanspruchen Stakingbelohnungen beanspruchen Schließen @@ -201,6 +203,7 @@ NFT Nein Keine Adresse + Nicht hinzugefügt Jetzt OK Im Browser öffnen @@ -476,14 +479,12 @@ Dein Portfolio wurde aktualisiert Der ausgewählte Token ist derzeit nicht für Aktionen innerhalb der Krypto-Wallet verfügbar. Aber keine Sorge, du kannst dein Interesse bekunden, indem du den Token hochstufen. Hochstimmen - Wallet auswählen Das Wallet unterstützt nicht mehr als ein Netzwerk Um dieses Asset zu kaufen, zu tauschen oder zu erhalten, füge diesen Deinem Portfolio hinzu Dieses Asset wird derzeit in der Wallet nicht unterstützt. Dieses Asset ist für dieses Wallet nicht verfügbar Hinzufügen APY %s - Verfügbare Netzwerke Mein Portfolio Markt Um Adressen für ausgewählte Netzwerke zu generieren, musst du eine Tangem-Karte oder Ring scannen @@ -617,7 +618,6 @@ NFT erhalten Du hast dieses Netzwerk noch nicht hinzugefügt. Um NFTs zu erhalten, füge es Deinem Portfolio hinzu. Netzwerk nicht hinzugefügt - Nicht hinzugefügt Nicht unterstützte NFT-Arten cNFTs und pNFTs werden derzeit nicht unterstützt. Bitte sende diese nicht an Deine Wallet. NFT senden diff --git a/core/res/src/main/res/values-es/strings.xml b/core/res/src/main/res/values-es/strings.xml index 39ee2f7881..6f67b2c033 100644 --- a/core/res/src/main/res/values-es/strings.xml +++ b/core/res/src/main/res/values-es/strings.xml @@ -115,6 +115,7 @@ Aprobación Aprobar Atención + Redes disponibles Saldo: %s Saldo autenticación biométrica @@ -128,6 +129,7 @@ Elige una acción Elegir red Elige token + Elegir wallet Reclamar Reclame recompensas Cerrar @@ -188,6 +190,7 @@ NFT No Ninguna dirección + No aregada Ahora OK Abrir en el navegador @@ -448,14 +451,12 @@ Su portafolio ha sido actualizada El token seleccionado no está disponible actualmente para acciones dentro de la billetera cripto. Pero no se preocupa, puede expresar su interés votando a favor. Votar a favor - Elegir wallet La billetera no admite más de una red Para comprar, intercambiar o recibir este activo, agréguelo a su portafolio Este activo no está disponible en la billetera Este activo no está disponible para esta billetera Añadir APY %s - Redes disponibles Mi portafolio Mercado Para generar direcciones para las redes seleccionadas, debe escanear su tarjeta Tangem @@ -589,7 +590,6 @@ Recibir NFT Todavía no ha agregado esta red. Para recibir NFTs, añádala a su portafolio. Red no agregada - No aregada Tipos de NFT no compatibles cNFT y pNFT aún no son compatibles. Por favor, no los envíes a tu billetera. Enviar NFT diff --git a/core/res/src/main/res/values-fr/strings.xml b/core/res/src/main/res/values-fr/strings.xml index 3973a3df94..a4140af715 100644 --- a/core/res/src/main/res/values-fr/strings.xml +++ b/core/res/src/main/res/values-fr/strings.xml @@ -105,6 +105,7 @@ Approbation Approuver Attention + Réseaux disponibles Solde : %s Solde authentification biométrique @@ -118,6 +119,7 @@ Choisissez une action Choisissez le réseau Choisir le jeton + Choisissez un portefeuille Réclamer Réclamez des récompenses Fermer @@ -175,6 +177,7 @@ NFT Non Aucune adresse + Non ajouté Maintenant OK Ouvrir dans le navigateur @@ -434,14 +437,12 @@ Votre portfolio a été mis à jour Le jeton sélectionné n\'est actuellement pas disponible pour des actions dans le portefeuille crypto. Mais ne vous inquiétez pas, vous pouvez exprimer votre intérêt en votant positivement. Vote positif - Choisissez un portefeuille Le portefeuille ne prend pas en charge plus d\'un réseau Pour acheter, échanger ou recevoir cet actif, ajoutez-le à votre portefeuille Cet actif n\'est pas pris en charge dans le portefeuille Cet actif n\'est pas disponible pour ce portefeuille Ajoutez un jeton APY %s - Réseaux disponibles Mon portfolio Marché Pour générer des adresses pour les réseaux sélectionnés, vous devez scanner votre carte Tangem @@ -575,7 +576,6 @@ Recevoir des NFT Vous n\'avez pas encore ajouté ce réseau. Pour recevoir des NFT, ajoutez-le à votre portefeuille. Réseau non ajouté - Non ajouté Types de NFT non pris en charge Les cNFT et les pNFT ne sont pas encore pris en charge Envoyer un NFT diff --git a/core/res/src/main/res/values-ja/strings.xml b/core/res/src/main/res/values-ja/strings.xml index 93c2b842f3..a785951f19 100644 --- a/core/res/src/main/res/values-ja/strings.xml +++ b/core/res/src/main/res/values-ja/strings.xml @@ -145,6 +145,7 @@ 承認 承認 注意 + 利用可能なネットワーク バックアップ 残高: %s 残高 @@ -159,6 +160,7 @@ アクションを選択 ネットワークを選択 トークンを選択 + ウォレットを選択 請求 報酬を受け取る 閉じる @@ -218,6 +220,7 @@ NFT いいえ アドレスがありません + 未追加 わかりました ブラウザで開く @@ -329,6 +332,9 @@ 詳細 インターネット接続を確認するか、別のネットワークに切り替えてください。 利用規約 + 他のネットワークで資産を送金すると、永久に失われます。 + %sネットワーク + 下記のみを使用して資金を送金する 別のウォレットのカードまたはリングを使用しました。このウォレットにリンクしているカードまたはリングをタップしてください。 取引に必要な資金が不足しています。アカウントに入金してください。 マイトークン @@ -494,14 +500,12 @@ ポートフォリオが更新されました 選択したトークンは現在、暗号資産ウォレット内でのアクションには利用できません。しかし、心配しないでください。賛成票を投じることで関心を表明できます。 賛成票を投じる - ウォレットを選択 ウォレットは複数のネットワークをサポートしていません。 このアセットを購入・交換・受け取るには、ポートフォリオに追加してください。 このアセットは現在ウォレットで利用できません このアセットはこのウォレットでは使用できません。 追加 APY %s - 利用可能なネットワーク 私のポートフォリオ マーケット 選択したネットワークのアドレスを生成するには、Tangemウォレットカードまたはリングをスキャンする必要があります。 @@ -632,7 +636,6 @@ NFTを受け取る このネットワークはまだ追加されていません。NFTを受け取るには、ポートフォリオに追加してください。 ネットワークが追加されていません - 未追加 サポートされていないNFTタイプ cNFTとpNFTはまだサポートされていません。ウォレットに送信しないでください。 NFTを送信する @@ -1426,6 +1429,7 @@ ネットワーク 無制限 ウォレット + 接続されたアプリ 接続されたネットワーク ウォレットの残高とアクティビティを表示する 通知なしに取引に署名する @@ -1456,6 +1460,8 @@ リクエスト元 とにかく送金 署名タイプ + dApp接続には、少なくとも1つのネットワークが必要です + 選択したネットワークを指定する 宛先 取引リクエスト 取引リクエスト diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml index 474f997c12..68950a67cc 100644 --- a/core/res/src/main/res/values-ru/strings.xml +++ b/core/res/src/main/res/values-ru/strings.xml @@ -102,6 +102,7 @@ Одобрение Подтвердить Внимание + Доступные сети Баланс: %s Баланс биометрическую аутентификацию @@ -115,6 +116,7 @@ Выберите действие Выберите сеть Выберите токен + Выберите кошелек Получить Вывести награду Закрыть @@ -174,6 +176,7 @@ NFT Нет Нет адреса + Не добавлено Сейчас OK Открыть в браузере @@ -427,13 +430,11 @@ Ваш портфель был обновлен Выбранный токен не доступен в кошельке на данный момент. Но не переживайте, вы можете выразить свой интерес проголосовав за его добавление. Голосовать - Выберите кошелек Кошелёк не поддерживает более одной сети Чтобы купить, обменять или получить данный токен, вам нужно добавить его к себе в портфель Этот актив в настоящее время не поддерживается в кошельке Этот токен не доступен для данного кошелька Добавить - Доступные сети Мой портфель Рынок Чтобы создать адреса для выбранных сетей, отсканируйте вашу карту или кольцо Tangem кошелька @@ -573,7 +574,6 @@ Получить NFT Вы ещё не добавили эту сеть. Чтобы получать NFT, добавьте её в ваш портфель. Сеть не добавлена - Не добавлено Неподдерживаемый тип NFT cNFT и pNFT не поддерживаются. Пожалуйста, не отправляйте их на свой кошелёк. Отправить NFT @@ -1281,7 +1281,7 @@ Возможно, баланс устарел. Обновите страницу. Недостаточно %1$s. Пополните свой счет %2$s для выполнения ассоциации токена Открыть Trustline - Согласно правилам сети, чтобы пополнить этот токен, необходимо сначала открыть Trustline — это позволит вашему кошельку принимать и хранить этот актив. + Чтобы получить этот токен, необходимо включить Trustline. Сеть требует резерв %1$s %2$s. Требуется трастлайн Вредоносный домен Неизвестный домен diff --git a/core/res/src/main/res/values-uk-rUA/strings.xml b/core/res/src/main/res/values-uk-rUA/strings.xml index 5a09461ddc..bc736e28ba 100644 --- a/core/res/src/main/res/values-uk-rUA/strings.xml +++ b/core/res/src/main/res/values-uk-rUA/strings.xml @@ -102,6 +102,7 @@ Затвердження Підтвердити Увага + Доступні мережі Баланс: %s Баланс біометричну автентифікацію @@ -114,6 +115,7 @@ Змінити Виберіть дію Оберіть токен + Оберіть гаманець Отримати Отримати винагороди Закрити @@ -173,6 +175,7 @@ NFT Ні Немає адреси + Не додано Зараз ОК Відкрити в браузері @@ -426,13 +429,11 @@ Ваше портфоліо оновлено Обраний токен наразі недоступний для дій у криптогаманці. Але не хвилюйтеся, ви можете висловити свою зацікавленість, проголосувавши за його інтеграцію. Проголосувати - Оберіть гаманець Гаманець не підтримує більше однієї мережі Щоб купити, обміняти або отримати цей актив, додайте його до свого портфоліо Цей актив наразі не підтримується в гаманці Цей токен недоступний для цього гаманця Додати - Доступні мережі Моє портфоліо Маркет Щоб згенерувати адреси для обраних мереж, відскануйте вашу картку або кільце Tangem гаманця @@ -572,7 +573,6 @@ Отримати NFT Ви ще не додали цю мережу. Щоб отримувати NFT, додайте її до свого портфоліо. Мережу не додано - Не додано Непідтримувані типи NFT cNFT і pNFT наразі не підтримуються. Будь ласка, не надсилайте їх на свій гаманець. Надіслати NFT @@ -1280,7 +1280,7 @@ Баланс може бути застарілим. Оновіть сторінку. Недостатньо %1$s. Поповніть свій рахунок %2$s, щоб прив’язати цей токен. Відкрити Trustline - Відповідно до правил мережі, щоб поповнити цей токен, спочатку потрібно відкрити Trustline — це дозволить вашому гаманцю приймати та зберігати цей актив. + Щоб отримати цей токен, потрібно увімкнути Trustline. Мережа вимагає резерв %1$s %2$s. Відкрийте Trustline Будь ласка, поверніться до браузеру і повторно підключіться через WalletConnect. Обрана не вірна картка або кільце diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 70f17192aa..039b9d2cdb 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -149,6 +149,7 @@ Approval Approve Attention + Available networks Backup Balance: %s Balance @@ -163,6 +164,7 @@ Choose action Choose network Choose token + Choose wallet Claim Claim rewards Close @@ -224,6 +226,7 @@ NFT No No address + Not Added Now OK Open in Browser @@ -239,6 +242,7 @@ Reject Reload Rename + Required Save Save changes Search @@ -336,6 +340,9 @@ Details Check your internet connection or switch to a different network Terms of service + Sending assets in other networks will result in permanent loss. + %s network + Send funds using only You have used a card or ring from another wallet. Tap the card or ring associated with this wallet Not enough funds for the transaction. Please top up your account. My tokens @@ -506,14 +513,12 @@ Your portfolio has been updated The selected token is currently unavailable for actions within the crypto wallet. But worry not, you can express your interest by upvoting it. Upvote - Choose wallet The wallet doesn\'t support more than one network To buy, exchange, or receive this asset, add it to your portfolio This asset is currently not supported in the wallet This asset is not available for this wallet Add APY %s - Available networks My portfolio Market To generate addresses for selected networks, you must scan your Tangem Wallet card or ring @@ -647,7 +652,6 @@ Receive NFT You haven\'t added this network yet. To receive NFTs, add it to your portfolio. Network not added - Not Added Unsupported NFT types cNFTs and pNFTs are not supported yet. Please don\'t send them to your wallet. Send NFT @@ -1367,9 +1371,11 @@ Discover Tangem Wallet Secret code to protect this wallet. Used for login and signatures. Set/Change Access Code + Change Access Code Stay notified on wallet incoming transactions and Tangem updates. Push notifications may currently not work on Huawei devices. We\'re actively working on a solution and will release a fix in an upcoming update. Thank you for your understanding! Transaction Notifications + Set Access Code Wallet settings Tangem Use %s or scan a card/ring to unlock access to your wallet @@ -1487,6 +1493,7 @@ Verified domain Wrong card or ring selected in the App We\'ve got some kind of problem + All dApps disconnected Allow to spend Address Connect @@ -1495,7 +1502,9 @@ Networks Unlimited Wallet + Connected App Connected networks + Connected to %1$s View your wallet balance and activity Sign transactions without your notice Request approval for transactions @@ -1506,6 +1515,7 @@ Contents Copy data Custom allowance + dApp disconnected Disconnect all Text about discnected all dApps Disconect All dApps @@ -1513,6 +1523,8 @@ The transaction couldn\'t be simulated. Please proceed with caution. Estimation is not supported for %s Suggested by %s + Top up your balance to cover the network fee + Insufficient %1$s Malicious transaction Add the %s network to your portfolio for this wallet The wallet has no required networks @@ -1525,6 +1537,9 @@ Request from Send anyway Signature Type + At least one network is required for dApp connection + Specify selected networks + Successfully signed To Transaction request Transaction request diff --git a/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/ui/WalletSelectorBottomSheet.kt b/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/ui/WalletSelectorBottomSheet.kt index 615c95ba9f..23e63c41f4 100644 --- a/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/ui/WalletSelectorBottomSheet.kt +++ b/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/ui/WalletSelectorBottomSheet.kt @@ -36,7 +36,7 @@ internal fun WalletSelectorBottomSheet(config: TangemBottomSheetConfig) { addBottomInsets = false, title = { content -> TangemTopAppBar( - title = resourceReference(R.string.manage_tokens_wallet_selector_title), + title = resourceReference(R.string.common_choose_wallet), titleAlignment = Alignment.CenterHorizontally, startButton = TopAppBarButtonUM.Back(content.onBack), height = TangemTopAppBarHeight.BOTTOM_SHEET, diff --git a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/receive/ui/NFTReceiveNetworksContent.kt b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/receive/ui/NFTReceiveNetworksContent.kt index 26d245c7f2..06c8648a94 100644 --- a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/receive/ui/NFTReceiveNetworksContent.kt +++ b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/receive/ui/NFTReceiveNetworksContent.kt @@ -58,7 +58,7 @@ internal fun NFTReceiveNetworksContent(state: NFTReceiveUM.Networks.Content, mod item( key = "not_available_title", ) { - Title(resourceReference(R.string.nft_receive_unavailable_section_title)) + Title(resourceReference(R.string.common_not_added)) } networks(state.unavailableItems) } diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/AlertsComponent.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/AlertsComponent.kt index c4c0032fa8..6fd6fde73b 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/AlertsComponent.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/AlertsComponent.kt @@ -33,38 +33,10 @@ internal class AlertsComponent( internal sealed class AlertType : TangemBottomSheetConfigContent { abstract val onDismiss: () -> Unit - @Serializable - data class VerifiedDomain(val appName: String, override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class UnknownDomain(val onConnect: () -> Unit, override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class UnsafeDomain(val onConnect: () -> Unit, override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class UnsupportedNetworks(val appName: String, override val onDismiss: () -> Unit) : AlertType() - @Serializable data class UnsupportedMethod(override val onDismiss: () -> Unit) : AlertType() @Serializable data class WcDisconnected(override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class UnknownError(val errorCode: Int, override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class WrongCardSelected(override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class ConnectionTimeout(val onTryAgain: () -> Unit, override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class MaliciousTransaction( - val descriptionMessage: String, - val onConnect: () -> Unit, - override val onDismiss: () -> Unit, - ) : AlertType() } } \ No newline at end of file diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectNetworksComponent.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectNetworksComponent.kt index b5e00c8355..5e6fa54da8 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectNetworksComponent.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectNetworksComponent.kt @@ -37,7 +37,7 @@ import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetWi import com.tangem.core.ui.components.notifications.Notification import com.tangem.core.ui.decompose.ComposableBottomSheetComponent import com.tangem.core.ui.extensions.resourceReference -import com.tangem.core.ui.extensions.stringReference +import com.tangem.core.ui.extensions.stringResourceSafe import com.tangem.core.ui.extensions.wrappedList import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemThemePreview @@ -98,7 +98,7 @@ private fun WcSelectNetworksBS( containerColor = TangemTheme.colors.background.tertiary, title = { TangemModalBottomSheetTitle( - title = stringReference("Choose networks"), + title = resourceReference(R.string.common_choose_network), startIconRes = R.drawable.ic_back_24, onStartClick = onBack, ) @@ -114,7 +114,7 @@ private fun WcSelectNetworksBS( modifier = Modifier .padding(16.dp) .fillMaxWidth(), - text = "Done", + text = stringResourceSafe(R.string.common_done), onClick = state.onDone, enabled = state.doneButtonEnabled, ) @@ -181,7 +181,7 @@ private fun AvailableNetworksBlock( Column(modifier = modifier) { Text( modifier = Modifier.padding(top = 12.dp, bottom = 4.dp, start = 12.dp, end = 12.dp), - text = "Available networks", + text = stringResourceSafe(R.string.common_available_networks), style = TangemTheme.typography.subtitle2, color = TangemTheme.colors.text.tertiary, ) @@ -203,7 +203,7 @@ private fun NotAddedBlock(notAdded: ImmutableList, modifier: Column(modifier = modifier) { Text( modifier = Modifier.padding(top = 12.dp, bottom = 4.dp, start = 12.dp, end = 12.dp), - text = "Not Added", + text = stringResourceSafe(R.string.common_not_added), style = TangemTheme.typography.subtitle2, color = TangemTheme.colors.text.tertiary, ) @@ -255,7 +255,7 @@ private fun NetworkItems(networkItem: WcNetworkInfoItem, modifier: Modifier = Mo } } is WcNetworkInfoItem.Required -> Text( - text = "Required", + text = stringResourceSafe(R.string.common_required), style = TangemTheme.typography.body2, color = TangemTheme.colors.text.tertiary, ) diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectWalletComponent.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectWalletComponent.kt index 0c463ff816..92ff58d06f 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectWalletComponent.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectWalletComponent.kt @@ -28,6 +28,7 @@ import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheet import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetTitle import com.tangem.core.ui.decompose.ComposableBottomSheetComponent import com.tangem.core.ui.extensions.TextReference +import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.extensions.wrappedList import com.tangem.core.ui.res.TangemTheme @@ -91,7 +92,7 @@ private fun WcSelectWalletModalBS( containerColor = TangemTheme.colors.background.primary, title = { TangemModalBottomSheetTitle( - title = stringReference("Choose wallet"), + title = resourceReference(R.string.common_choose_wallet), startIconRes = R.drawable.ic_back_24, onStartClick = onBack, ) @@ -145,77 +146,62 @@ private fun WcSelectWalletContent( @Preview(showBackground = true, device = Devices.PIXEL_7_PRO) @Preview(showBackground = true, device = Devices.PIXEL_7_PRO, uiMode = Configuration.UI_MODE_NIGHT_YES) private fun WcSelectWalletContent_Preview() { + val wallets = persistentListOf( + UserWalletItemUM( + id = UserWalletId("user_wallet_1".encodeToByteArray()), + name = stringReference("Tangem 2.0"), + information = getInformation(42), + balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false), + isEnabled = true, + onClick = {}, + ), + UserWalletItemUM( + id = UserWalletId("user_wallet_2".encodeToByteArray()), + name = stringReference("Tangem White"), + information = getInformation(24), + balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false), + isEnabled = true, + onClick = {}, + ), + UserWalletItemUM( + id = UserWalletId("user_wallet_3".encodeToByteArray()), + name = stringReference("Bitcoin"), + information = getInformation(1), + balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false), + isEnabled = true, + onClick = {}, + ), + UserWalletItemUM( + id = UserWalletId("user_wallet_4".encodeToByteArray()), + name = stringReference("Tangem 1.0"), + information = getInformation(21), + balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false), + isEnabled = true, + onClick = {}, + ), + UserWalletItemUM( + id = UserWalletId("user_wallet_4".encodeToByteArray()), + name = stringReference("Tangem 1.0"), + information = UserWalletItemUM.Information.Loading, + balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false), + isEnabled = true, + onClick = {}, + ), + UserWalletItemUM( + id = UserWalletId("user_wallet_4".encodeToByteArray()), + name = stringReference("Tangem 1.0"), + information = UserWalletItemUM.Information.Failed, + balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false), + isEnabled = true, + onClick = {}, + ), + ) TangemThemePreview { - TangemModalBottomSheet( - containerColor = TangemTheme.colors.background.primary, - config = TangemBottomSheetConfig( - isShown = true, - onDismissRequest = {}, - content = TangemBottomSheetConfigContent.Empty, - ), - title = { - TangemModalBottomSheetTitle( - title = stringReference("Choose wallet"), - onEndClick = {}, - endIconRes = R.drawable.ic_close_24, - ) - }, - content = { - WcSelectWalletContent( - modifier = Modifier.padding(start = 16.dp, end = 16.dp, bottom = 16.dp), - selectedWalletId = UserWalletId("user_wallet_1".encodeToByteArray()), - wallets = persistentListOf( - UserWalletItemUM( - id = UserWalletId("user_wallet_1".encodeToByteArray()), - name = stringReference("Tangem 2.0"), - information = getInformation(42), - balance = UserWalletItemUM.Balance.Loaded("1 496,34 \$", isFlickering = false), - isEnabled = true, - onClick = {}, - ), - UserWalletItemUM( - id = UserWalletId("user_wallet_2".encodeToByteArray()), - name = stringReference("Tangem White"), - information = getInformation(24), - balance = UserWalletItemUM.Balance.Loaded("1 496,34 \$", isFlickering = false), - isEnabled = true, - onClick = {}, - ), - UserWalletItemUM( - id = UserWalletId("user_wallet_3".encodeToByteArray()), - name = stringReference("Bitcoin"), - information = getInformation(1), - balance = UserWalletItemUM.Balance.Loaded("1 496,34 \$", isFlickering = false), - isEnabled = true, - onClick = {}, - ), - UserWalletItemUM( - id = UserWalletId("user_wallet_4".encodeToByteArray()), - name = stringReference("Tangem 1.0"), - information = getInformation(21), - balance = UserWalletItemUM.Balance.Loaded("1 496,34 \$", isFlickering = false), - isEnabled = true, - onClick = {}, - ), - UserWalletItemUM( - id = UserWalletId("user_wallet_4".encodeToByteArray()), - name = stringReference("Tangem 1.0"), - information = UserWalletItemUM.Information.Loading, - balance = UserWalletItemUM.Balance.Loaded("1 496,34 \$", isFlickering = false), - isEnabled = true, - onClick = {}, - ), - UserWalletItemUM( - id = UserWalletId("user_wallet_4".encodeToByteArray()), - name = stringReference("Tangem 1.0"), - information = UserWalletItemUM.Information.Failed, - balance = UserWalletItemUM.Balance.Loaded("1 496,34 \$", isFlickering = false), - isEnabled = true, - onClick = {}, - ), - ), - ) - }, + WcSelectWalletModalBS( + wallets = wallets, + selectedWalletId = wallets.first().id, + onBack = {}, + onDismiss = {}, ) } } diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectedAppInfoModel.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectedAppInfoModel.kt index b35c69510f..6b0bb827d2 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectedAppInfoModel.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectedAppInfoModel.kt @@ -7,9 +7,9 @@ import com.domain.blockaid.models.dapp.CheckDAppResult import com.tangem.core.decompose.di.ModelScoped import com.tangem.core.decompose.model.Model 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.iconResId +import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.message.SnackbarMessage import com.tangem.domain.walletconnect.model.WcSession @@ -23,6 +23,7 @@ import com.tangem.features.walletconnect.connections.entity.WcPrimaryButtonConfi import com.tangem.features.walletconnect.connections.entity.WcAppInfoSecurityNotification import com.tangem.features.walletconnect.connections.model.transformers.WcAppSubtitleConverter import com.tangem.features.walletconnect.connections.routes.ConnectedAppInfoRoutes +import com.tangem.features.walletconnect.impl.R import com.tangem.utils.coroutines.CoroutineDispatcherProvider import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.flow.MutableStateFlow @@ -35,7 +36,6 @@ import javax.inject.Inject @Stable @ModelScoped internal class WcConnectedAppInfoModel @Inject constructor( - private val router: Router, private val wcSessionsUseCase: WcSessionsUseCase, private val messageSender: UiMessageSender, private val disconnectUseCase: WcDisconnectUseCase, @@ -121,7 +121,7 @@ internal class WcConnectedAppInfoModel @Inject constructor( } modelScope.launch { disconnectUseCase.disconnect(session) - messageSender.send(SnackbarMessage(message = stringReference("dApp disconnected"))) + messageSender.send(SnackbarMessage(message = resourceReference(R.string.wc_dapp_disconnected))) dismiss() } } diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectionsModel.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectionsModel.kt index 9efea80a5b..666eb2eb8f 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectionsModel.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectionsModel.kt @@ -13,7 +13,6 @@ import com.tangem.core.decompose.ui.UiMessageSender import com.tangem.core.ui.components.appbar.models.TopAppBarButtonUM import com.tangem.core.ui.components.dropdownmenu.TangemDropdownMenuItem 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 @@ -50,7 +49,7 @@ internal class WcConnectionsModel @Inject constructor( private val wcDisconnectUseCase: WcDisconnectUseCase, private val wcPairService: WcPairService, override val dispatchers: CoroutineDispatcherProvider, - private val analytics: AnalyticsEventHandler, + analytics: AnalyticsEventHandler, paramsContainer: ParamsContainer, ) : Model() { @@ -127,7 +126,7 @@ internal class WcConnectionsModel @Inject constructor( private fun disconnectAllSessions() { modelScope.launch { wcDisconnectUseCase.disconnectAll() - uiMessageSender.send(SnackbarMessage(message = stringReference("All dApps disconnected"))) + uiMessageSender.send(SnackbarMessage(message = resourceReference(R.string.wc_all_dapps_disconnected))) } } diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcPairModel.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcPairModel.kt index bbac86dbfd..9a63c9baad 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcPairModel.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcPairModel.kt @@ -11,7 +11,9 @@ import com.tangem.core.decompose.model.Model 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.extensions.wrappedList import com.tangem.core.ui.message.SnackbarMessage import com.tangem.core.ui.message.ToastMessage import com.tangem.domain.models.network.Network @@ -30,6 +32,7 @@ import com.tangem.features.walletconnect.connections.entity.WcAppInfoUM import com.tangem.features.walletconnect.connections.entity.WcPrimaryButtonConfig import com.tangem.features.walletconnect.connections.model.transformers.* import com.tangem.features.walletconnect.connections.routes.WcAppInfoRoutes +import com.tangem.features.walletconnect.impl.R import com.tangem.utils.coroutines.CoroutineDispatcherProvider import kotlinx.coroutines.flow.* import javax.inject.Inject @@ -199,9 +202,13 @@ internal class WcPairModel @Inject constructor( } private fun processSuccessfullyConnected(session: WcSession) { - // TODO: [REDACTED_JIRA] localization messageSender.send( - SnackbarMessage(message = stringReference("Connected to ${session.sdkModel.appMetaData.name}")), + SnackbarMessage( + message = resourceReference( + id = R.string.wc_connected_to, + formatArgs = wrappedList(session.sdkModel.appMetaData.name), + ), + ), ) } diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcConnectButtonAvailabilityConverter.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcConnectButtonAvailabilityConverter.kt index 72042b2e79..63de5cb522 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcConnectButtonAvailabilityConverter.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcConnectButtonAvailabilityConverter.kt @@ -3,7 +3,6 @@ package com.tangem.features.walletconnect.connections.model.transformers import com.tangem.domain.models.network.Network import com.tangem.utils.converter.Converter -@Suppress("DestructuringDeclarationWithTooManyEntries") internal object WcConnectButtonAvailabilityConverter : Converter { override fun convert(value: Input): Boolean { diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcNetworksInfoConverter.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcNetworksInfoConverter.kt index 4d690bc279..ee51c67235 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcNetworksInfoConverter.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcNetworksInfoConverter.kt @@ -7,7 +7,6 @@ import com.tangem.features.walletconnect.connections.entity.WcNetworksInfo import com.tangem.utils.converter.Converter import kotlinx.collections.immutable.toImmutableList -@Suppress("DestructuringDeclarationWithTooManyEntries") internal object WcNetworksInfoConverter : Converter { override fun convert(value: Input): WcNetworksInfo { val missing = value.missingNetworks diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/AlertsModalBottomSheet.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/AlertsModalBottomSheet.kt index ef033fa61e..7c93a184f5 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/AlertsModalBottomSheet.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/AlertsModalBottomSheet.kt @@ -6,7 +6,6 @@ import androidx.annotation.StringRes import androidx.compose.foundation.background import androidx.compose.foundation.layout.* import androidx.compose.foundation.shape.CircleShape -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -23,7 +22,6 @@ import androidx.compose.ui.unit.dp import com.tangem.core.ui.R import com.tangem.core.ui.components.PrimaryButton import com.tangem.core.ui.components.SecondaryButton -import com.tangem.core.ui.components.SecondaryButtonIconEnd import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheet import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetTitle @@ -77,7 +75,6 @@ private fun ContentContainer(alert: AlertsComponent.AlertType, modifier: Modifie .padding(top = TangemTheme.dimens.spacing8), alert = alert, ) - AlertAudit(alert, modifier = Modifier.padding(top = TangemTheme.dimens.spacing16)) } } @@ -90,71 +87,12 @@ private fun ButtonsContainer(alert: AlertsComponent.AlertType, modifier: Modifie ) { val buttonsModifier = Modifier.fillMaxWidth() when (alert) { - is AlertsComponent.AlertType.UnsafeDomain -> { - PrimaryButton( - modifier = buttonsModifier, - text = stringResourceSafe(R.string.common_cancel), - onClick = alert.onDismiss, - ) - SecondaryButton( - modifier = buttonsModifier, - onClick = alert.onConnect, - text = stringResourceSafe(R.string.wc_alert_connect_anyway), - ) - } - is AlertsComponent.AlertType.MaliciousTransaction -> { - PrimaryButton( - modifier = buttonsModifier, - text = stringResourceSafe(R.string.common_cancel), - onClick = alert.onDismiss, - ) - SecondaryButtonIconEnd( - modifier = buttonsModifier, - onClick = alert.onConnect, - iconResId = R.drawable.ic_tangem_24, - text = stringResourceSafe(R.string.wc_alert_connect_anyway), - ) - } - is AlertsComponent.AlertType.UnknownDomain -> { - PrimaryButton( - modifier = buttonsModifier, - text = stringResourceSafe(R.string.common_cancel), - onClick = alert.onDismiss, - ) - SecondaryButton( - modifier = buttonsModifier, - onClick = alert.onConnect, - text = stringResourceSafe(R.string.wc_alert_connect_anyway), - ) - } - is AlertsComponent.AlertType.VerifiedDomain -> SecondaryButton( - modifier = buttonsModifier, - text = stringResourceSafe(R.string.common_done), - onClick = alert.onDismiss, - ) - is AlertsComponent.AlertType.ConnectionTimeout -> { - PrimaryButton( - modifier = buttonsModifier, - onClick = alert.onTryAgain, - text = stringResourceSafe(R.string.alert_button_try_again), - ) - SecondaryButton( - modifier = buttonsModifier, - onClick = alert.onDismiss, - text = stringResourceSafe(R.string.balance_hidden_got_it_button), - ) - } - is AlertsComponent.AlertType.WrongCardSelected, - is AlertsComponent.AlertType.UnknownError, - is AlertsComponent.AlertType.UnsupportedMethod, - -> SecondaryButton( + is AlertsComponent.AlertType.UnsupportedMethod -> SecondaryButton( modifier = buttonsModifier, onClick = alert.onDismiss, text = stringResourceSafe(R.string.balance_hidden_got_it_button), ) - is AlertsComponent.AlertType.WcDisconnected, - is AlertsComponent.AlertType.UnsupportedNetworks, - -> PrimaryButton( + is AlertsComponent.AlertType.WcDisconnected -> PrimaryButton( modifier = buttonsModifier, onClick = alert.onDismiss, text = stringResourceSafe(R.string.balance_hidden_got_it_button), @@ -166,49 +104,17 @@ private fun ButtonsContainer(alert: AlertsComponent.AlertType, modifier: Modifie @Composable private fun AlertIcon(alert: AlertsComponent.AlertType, modifier: Modifier = Modifier) { val color = when (alert) { - is AlertsComponent.AlertType.VerifiedDomain -> TangemTheme.colors.icon.accent - is AlertsComponent.AlertType.WcDisconnected, - is AlertsComponent.AlertType.ConnectionTimeout, - is AlertsComponent.AlertType.UnsupportedNetworks, - -> TangemTheme.colors.icon.informative - is AlertsComponent.AlertType.WrongCardSelected, - is AlertsComponent.AlertType.UnknownDomain, - is AlertsComponent.AlertType.UnknownError, - is AlertsComponent.AlertType.UnsupportedMethod, - -> TangemTheme.colors.icon.attention - is AlertsComponent.AlertType.MaliciousTransaction, - is AlertsComponent.AlertType.UnsafeDomain, - -> TangemTheme.colors.icon.warning + is AlertsComponent.AlertType.WcDisconnected -> TangemTheme.colors.icon.informative + is AlertsComponent.AlertType.UnsupportedMethod -> TangemTheme.colors.icon.attention } @DrawableRes val drawableId = when (alert) { - is AlertsComponent.AlertType.WcDisconnected, - is AlertsComponent.AlertType.ConnectionTimeout, - -> R.drawable.ic_wallet_connect_24 - is AlertsComponent.AlertType.MaliciousTransaction -> R.drawable.img_knight_shield_32 - is AlertsComponent.AlertType.UnknownDomain, - is AlertsComponent.AlertType.UnsafeDomain, - -> R.drawable.img_knight_shield_32 - is AlertsComponent.AlertType.UnsupportedNetworks -> R.drawable.ic_network_new_24 - is AlertsComponent.AlertType.WrongCardSelected, - is AlertsComponent.AlertType.UnknownError, - is AlertsComponent.AlertType.UnsupportedMethod, - -> R.drawable.img_attention_20 - is AlertsComponent.AlertType.VerifiedDomain -> R.drawable.img_approvale2_20 + is AlertsComponent.AlertType.WcDisconnected -> R.drawable.ic_wallet_connect_24 + is AlertsComponent.AlertType.UnsupportedMethod -> R.drawable.img_attention_20 } val iconTint = when (alert) { - is AlertsComponent.AlertType.UnknownDomain, - is AlertsComponent.AlertType.UnsafeDomain, - is AlertsComponent.AlertType.MaliciousTransaction, - is AlertsComponent.AlertType.UnsupportedNetworks, - is AlertsComponent.AlertType.ConnectionTimeout, - is AlertsComponent.AlertType.WcDisconnected, - -> color - is AlertsComponent.AlertType.VerifiedDomain, - is AlertsComponent.AlertType.UnknownError, - is AlertsComponent.AlertType.WrongCardSelected, - is AlertsComponent.AlertType.UnsupportedMethod, - -> Color.Unspecified + is AlertsComponent.AlertType.WcDisconnected -> color + is AlertsComponent.AlertType.UnsupportedMethod -> Color.Unspecified } Box( modifier = modifier @@ -230,16 +136,7 @@ private fun AlertIcon(alert: AlertsComponent.AlertType, modifier: Modifier = Mod @Composable private fun AlertContentTitle(alert: AlertsComponent.AlertType, modifier: Modifier = Modifier) { @StringRes val titleRes: Int = when (alert) { - is AlertsComponent.AlertType.UnknownDomain, - is AlertsComponent.AlertType.UnsafeDomain, - is AlertsComponent.AlertType.MaliciousTransaction, - -> R.string.security_alert_title - is AlertsComponent.AlertType.ConnectionTimeout -> R.string.wc_alert_connection_timeout_title - is AlertsComponent.AlertType.UnknownError -> R.string.wc_alert_unknown_error_title - is AlertsComponent.AlertType.UnsupportedNetworks -> R.string.wc_alert_unsupported_networks_title - is AlertsComponent.AlertType.VerifiedDomain -> R.string.wc_alert_verified_domain_title is AlertsComponent.AlertType.WcDisconnected -> R.string.wc_alert_session_disconnected_title - is AlertsComponent.AlertType.WrongCardSelected -> R.string.wc_alert_wrong_card_title is AlertsComponent.AlertType.UnsupportedMethod -> R.string.wc_alert_unsupported_method_title } Text( @@ -254,29 +151,9 @@ private fun AlertContentTitle(alert: AlertsComponent.AlertType, modifier: Modifi @Composable private fun AlertContentDescription(alert: AlertsComponent.AlertType, modifier: Modifier = Modifier) { val message = when (alert) { - is AlertsComponent.AlertType.ConnectionTimeout -> stringResourceSafe( - R.string.wc_alert_connection_timeout_description, - ) - is AlertsComponent.AlertType.MaliciousTransaction -> alert.descriptionMessage - is AlertsComponent.AlertType.UnknownDomain, - is AlertsComponent.AlertType.UnsafeDomain, - -> stringResourceSafe(R.string.wc_alert_domain_issues_description) - is AlertsComponent.AlertType.UnknownError -> stringResourceSafe( - R.string.wc_alert_unknown_error_description, - alert.errorCode, - ) - is AlertsComponent.AlertType.UnsupportedNetworks -> stringResourceSafe( - R.string.wc_alert_unsupported_networks_description, - alert.appName, - ) - is AlertsComponent.AlertType.VerifiedDomain -> stringResourceSafe( - R.string.wc_alert_verified_domain_description, - alert.appName, - ) is AlertsComponent.AlertType.WcDisconnected -> stringResourceSafe( R.string.wc_alert_session_disconnected_description, ) - is AlertsComponent.AlertType.WrongCardSelected -> stringResourceSafe(R.string.wc_alert_wrong_card_description) is AlertsComponent.AlertType.UnsupportedMethod -> stringResourceSafe( R.string.wc_alert_unsupported_method_description, ) @@ -290,44 +167,6 @@ private fun AlertContentDescription(alert: AlertsComponent.AlertType, modifier: ) } -@Composable -private fun AlertAudit(alert: AlertsComponent.AlertType, modifier: Modifier = Modifier) { - when (alert) { - is AlertsComponent.AlertType.UnknownDomain -> Text( - modifier = modifier - .background( - shape = RoundedCornerShape(TangemTheme.dimens.radius16), - color = TangemTheme.colors.text.primary1.copy(alpha = 0.1F), - ) - .padding(vertical = TangemTheme.dimens.spacing4, horizontal = TangemTheme.dimens.spacing12), - text = stringResourceSafe(R.string.wc_alert_audit_unknown_domain), - style = TangemTheme.typography.caption1, - color = TangemTheme.colors.text.primary1, - ) - is AlertsComponent.AlertType.UnsafeDomain -> Text( - modifier = Modifier - .padding(top = TangemTheme.dimens.spacing16) - .background( - shape = RoundedCornerShape(TangemTheme.dimens.radius16), - color = TangemTheme.colors.text.warning.copy(alpha = 0.1F), - ) - .padding(vertical = TangemTheme.dimens.spacing4, horizontal = TangemTheme.dimens.spacing12), - text = stringResourceSafe(R.string.wc_alert_audit_unknown_domain), - style = TangemTheme.typography.caption1, - color = TangemTheme.colors.text.warning, - ) - is AlertsComponent.AlertType.ConnectionTimeout, - is AlertsComponent.AlertType.MaliciousTransaction, - is AlertsComponent.AlertType.UnknownError, - is AlertsComponent.AlertType.UnsupportedNetworks, - is AlertsComponent.AlertType.VerifiedDomain, - is AlertsComponent.AlertType.WcDisconnected, - is AlertsComponent.AlertType.WrongCardSelected, - is AlertsComponent.AlertType.UnsupportedMethod, - -> Unit - } -} - @Preview(showBackground = true) @Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES) @Composable @@ -347,19 +186,7 @@ private fun AlertsModalBottomSheet_Preview( private class AlertTypesProvider : CollectionPreviewParameterProvider( collection = listOf( - AlertsComponent.AlertType.VerifiedDomain(appName = "React App", onDismiss = {}), - AlertsComponent.AlertType.UnknownDomain(onConnect = {}, onDismiss = {}), - AlertsComponent.AlertType.UnsafeDomain(onConnect = {}, onDismiss = {}), - AlertsComponent.AlertType.MaliciousTransaction( - descriptionMessage = "The transaction approves erc20 tokens to a known malicious address", - onConnect = {}, - onDismiss = {}, - ), - AlertsComponent.AlertType.UnsupportedNetworks(appName = "React App", onDismiss = {}), AlertsComponent.AlertType.WcDisconnected(onDismiss = {}), - AlertsComponent.AlertType.UnknownError(errorCode = 8005, onDismiss = {}), - AlertsComponent.AlertType.WrongCardSelected(onDismiss = {}), - AlertsComponent.AlertType.ConnectionTimeout(onTryAgain = {}, onDismiss = {}), AlertsComponent.AlertType.UnsupportedMethod(onDismiss = {}), ), ) \ No newline at end of file diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcAppInfoBS.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcAppInfoBS.kt index 27957362b7..ebd0adbd3a 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcAppInfoBS.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcAppInfoBS.kt @@ -35,7 +35,10 @@ import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetTi import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetWithFooter import com.tangem.core.ui.components.notifications.Notification import com.tangem.core.ui.components.notifications.NotificationConfig -import com.tangem.core.ui.extensions.* +import com.tangem.core.ui.extensions.clickableSingle +import com.tangem.core.ui.extensions.resourceReference +import com.tangem.core.ui.extensions.stringResourceSafe +import com.tangem.core.ui.extensions.wrappedList import com.tangem.core.ui.res.TangemColorPalette import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemThemePreview @@ -286,9 +289,8 @@ private fun WcAppInfoSecondBlock(state: WcAppInfoUM.Content, modifier: Modifier Notification( config = NotificationConfig( iconResId = R.drawable.ic_alert_circle_24, - // TODO: [REDACTED_JIRA] localization - title = stringReference("Specify selected networks"), - subtitle = stringReference("At least one network is required for dApp connection"), + title = resourceReference(R.string.wc_specify_networks_title), + subtitle = resourceReference(R.string.wc_specify_networks_subtitle), ), iconTint = TangemTheme.colors.icon.attention, containerColor = TangemTheme.colors.background.action, diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcConnectedAppInfoBS.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcConnectedAppInfoBS.kt index 17f1d3de85..4a97cf03a1 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcConnectedAppInfoBS.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcConnectedAppInfoBS.kt @@ -23,7 +23,6 @@ import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheet import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetTitle import com.tangem.core.ui.components.notifications.Notification import com.tangem.core.ui.extensions.resourceReference -import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.extensions.stringResourceSafe import com.tangem.core.ui.extensions.wrappedList import com.tangem.core.ui.res.TangemColorPalette @@ -48,7 +47,7 @@ internal fun WcConnectedAppInfoBS(state: WcConnectedAppInfoUM) { containerColor = TangemTheme.colors.background.tertiary, title = { TangemModalBottomSheetTitle( - title = stringReference("Connected App"), // TODO: [REDACTED_JIRA] + title = resourceReference(R.string.wc_connected_app_title), subtitle = state.connectingTime?.let { timestamp -> resourceReference( R.string.send_date_format, diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/blockaid/TransactionCheckResultsUM.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/blockaid/TransactionCheckResultsUM.kt deleted file mode 100644 index 6bb884bc3c..0000000000 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/blockaid/TransactionCheckResultsUM.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.tangem.features.walletconnect.transaction.entity.blockaid - -internal data class TransactionCheckResultsUM( - val estimatedWalletChanges: WcEstimatedWalletChangesUM, - val notificationText: String? = null, -) \ No newline at end of file diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcCommonTransactionModel.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcCommonTransactionModel.kt index aa103cf52a..5acb41c803 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcCommonTransactionModel.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcCommonTransactionModel.kt @@ -2,8 +2,9 @@ package com.tangem.features.walletconnect.transaction.entity.common import com.tangem.core.decompose.ui.UiMessageSender import com.tangem.core.ui.extensions.TextReference -import com.tangem.core.ui.extensions.stringReference +import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.message.ToastMessage +import com.tangem.features.walletconnect.impl.R import kotlinx.coroutines.flow.StateFlow internal interface WcCommonTransactionModel { @@ -16,8 +17,7 @@ internal interface WcCommonTransactionModel { fun popBack() - // TODO: [REDACTED_JIRA] - fun showSuccessSignMessage(message: TextReference = stringReference("Successfully signed")) { + fun showSuccessSignMessage(message: TextReference = resourceReference(R.string.wc_successfully_signed)) { messageSender.send(ToastMessage(message = message)) } } \ No newline at end of file diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/utils/WcNotificationsFactory.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/utils/WcNotificationsFactory.kt index f36b09dc1c..8867a92b5d 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/utils/WcNotificationsFactory.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/utils/WcNotificationsFactory.kt @@ -4,7 +4,7 @@ import com.tangem.blockchain.common.transaction.TransactionFee import com.tangem.common.ui.notifications.NotificationUM import com.tangem.core.ui.components.notifications.NotificationConfig import com.tangem.core.ui.extensions.resourceReference -import com.tangem.core.ui.extensions.stringReference +import com.tangem.core.ui.extensions.wrappedList import com.tangem.domain.models.currency.CryptoCurrencyStatus import com.tangem.features.send.v2.api.entity.FeeSelectorUM import com.tangem.features.send.v2.api.subcomponents.feeSelector.utils.FeeCalculationUtils @@ -29,10 +29,12 @@ internal class WcNotificationsFactory @Inject constructor() { cryptoCurrencyStatus: CryptoCurrencyStatus, feeSelectorUM: FeeSelectorUM?, ): NotificationUM.Info? { - // TODO: [REDACTED_TASK_KEY] localization return NotificationUM.Info( - title = stringReference("Insufficient ${cryptoCurrencyStatus.currency.name}"), - subtitle = stringReference("Top up your balance to cover the network fee"), + title = resourceReference( + id = R.string.wc_insufficient_warning_title, + formatArgs = wrappedList(cryptoCurrencyStatus.currency.name), + ), + subtitle = resourceReference(R.string.wc_insufficient_warning_subtitle), ).takeIf { isFeeExceedsBalance(cryptoCurrencyStatus = cryptoCurrencyStatus, feeSelectorUM = feeSelectorUM) } }