From fa9589d1c7b7e1afcee09e9995d702cb5c975057 Mon Sep 17 00:00:00 2001 From: gomes <17035424+gomesalexandre@users.noreply.github.com> Date: Thu, 27 Nov 2025 13:13:35 +0100 Subject: [PATCH 1/2] feat: rename 'Recipient Address' -> 'Receive Address' --- src/assets/translations/de/main.json | 5 --- src/assets/translations/en/main.json | 11 +++--- src/assets/translations/es/main.json | 5 --- src/assets/translations/fr/main.json | 5 --- src/assets/translations/ja/main.json | 5 --- src/assets/translations/pt/main.json | 5 --- src/assets/translations/ru/main.json | 5 --- src/assets/translations/tr/main.json | 5 --- src/assets/translations/uk/main.json | 5 --- src/assets/translations/zh/main.json | 5 --- .../FiatRamps/FiatRampTradeFooter.tsx | 4 +-- .../LimitOrder/components/LimitOrderInput.tsx | 22 ++++++------ ...ss.tsx => useLimitOrderReceiveAddress.tsx} | 20 +++++------ ...ress.tsx => SharedTradeReceiveAddress.tsx} | 34 +++++++++---------- .../TradeConfirm/TradeConfirmFooter.tsx | 6 ++-- .../components/TradeConfirmSummary.tsx | 6 ++-- .../TradeInput/components/ConfirmSummary.tsx | 6 ++-- ...ecipientAddress.tsx => ReceiveAddress.tsx} | 16 ++++----- ...ntAddressRow.tsx => ReceiveAddressRow.tsx} | 16 ++++----- 19 files changed, 70 insertions(+), 116 deletions(-) rename src/components/MultiHopTrade/components/LimitOrder/hooks/{useLimitOrderRecipientAddress.tsx => useLimitOrderReceiveAddress.tsx} (89%) rename src/components/MultiHopTrade/components/SharedTradeInput/{SharedRecipientAddress.tsx => SharedTradeReceiveAddress.tsx} (93%) rename src/components/MultiHopTrade/components/TradeInput/components/{RecipientAddress.tsx => ReceiveAddress.tsx} (88%) rename src/components/{RecipientAddressRow.tsx => ReceiveAddressRow.tsx} (67%) diff --git a/src/assets/translations/de/main.json b/src/assets/translations/de/main.json index c98c7ad6b08..bb33f96f3a5 100644 --- a/src/assets/translations/de/main.json +++ b/src/assets/translations/de/main.json @@ -751,13 +751,8 @@ "slowSwapBody": "Dieser Wechsel kann einige Minuten dauern.", "thorSmartContractWalletUnsupported": "Das THORChain-Netzwerk unterstützt derzeit keine Smart Contract Wallets.", "intoAssetSymbolBody": "Sie können mit diesem Handel fortfahren, aber der Transaktionsverlauf für den Erhalt von %{assetSymbol} ist vorübergehend nicht verfügbar", - "recipientAddress": "Empfängeradresse", "changeAddress": "Retourgeld Adresse", "changeAddressExplainer": "Beim Senden von Kryptowährungen über UTXO-basierte Netzwerke werden alle Restbeträge Ihrer Transaktion an diese Adresse zurückgesendet.", - "customRecipientAddress": "Benutzerdefinierte Empfängeradresse", - "customRecipientAddressDescription": "Geben Sie eine benutzerdefinierte Empfängeradresse für diesen Handel ein", - "thisIsYourCustomRecipientAddress": "Dies ist Ihre benutzerdefinierte Empfängeradresse", - "enterCustomRecipientAddress": "Geben Sie eine benutzerdefinierte Empfängeradresse ein", "receiveAtLeast": "Erhalten Sie zumindest", "tooltip": { "continueSwapping": "Weiter tauschen, um die letzten Details zu erfahren", diff --git a/src/assets/translations/en/main.json b/src/assets/translations/en/main.json index e4e34e7e171..d23756f9460 100644 --- a/src/assets/translations/en/main.json +++ b/src/assets/translations/en/main.json @@ -752,13 +752,13 @@ "slowSwapBody": "This swap may take a few minutes to complete.", "thorSmartContractWalletUnsupported": "The THORChain network currently does not support smart contract wallets.", "intoAssetSymbolBody": "You can proceed with this trade, but transaction history for receiving %{assetSymbol} is temporarily unavailable", - "recipientAddress": "Recipient address", + "receiveAddress": "Receive address", "changeAddress": "Change address", "changeAddressExplainer": "When sending cryptocurrencies on UTXO-based networks, any leftover funds from your transaction are sent back to you at this address.", - "customRecipientAddress": "Custom recipient address", - "customRecipientAddressDescription": "Enter a custom recipient address for this trade", - "thisIsYourCustomRecipientAddress": "This is your custom recipient address", - "enterCustomRecipientAddress": "Enter custom recipient address", + "customReceiveAddress": "Custom receive address", + "customReceiveAddressDescription": "Enter a custom receive address for this trade", + "thisIsYourCustomReceiveAddress": "This is your custom receive address", + "enterCustomReceiveAddress": "Enter custom receive address", "receiveAtLeast": "Receive at least", "tooltip": { "continueSwapping": "Continue swapping for final details", @@ -830,7 +830,6 @@ "or": "or", "onChainName": "on %{chainName}", "unknownGas": "(unknown)", - "receiveAddress": "Receive Address", "receiveAddressDescription": "No %{chainName} address found from connected wallet. Manually enter an address", "disableThorTaprootReceive": "We've detected that you're sending to a taproot Bitcoin address. Due to THORChain limitations, receiving BTC to a taproot address is not currently supported. Please enter another address.", "toContinue": "to continue.", diff --git a/src/assets/translations/es/main.json b/src/assets/translations/es/main.json index c9ece8f41b3..062b4a096e4 100644 --- a/src/assets/translations/es/main.json +++ b/src/assets/translations/es/main.json @@ -751,13 +751,8 @@ "slowSwapBody": "Este intercambio puede tardar unos minutos en completarse.", "thorSmartContractWalletUnsupported": "Actualmente, la red THORChain no admite carteras de contratos inteligentes.", "intoAssetSymbolBody": "Puede continuar con este comercio, pero el historial de transacciones para recibir %{assetSymbol} no está disponible temporalmente", - "recipientAddress": "Dirección del receptor", "changeAddress": "Cambiar dirección", "changeAddressExplainer": "Al enviar criptomonedas de redes basadas en UTXO, los fondos sobrantes se envían de vuelta a esta dirección.", - "customRecipientAddress": "Dirección de destinatario personalizada", - "customRecipientAddressDescription": "Ingrese una dirección de destinatario personalizada para la transacción", - "thisIsYourCustomRecipientAddress": "Esta es su dirección de destino personalizada", - "enterCustomRecipientAddress": "Ingrese la dirección del destinatario personalizado", "receiveAtLeast": "Recibe al menos", "tooltip": { "continueSwapping": "Continúe intercambiando para obtener detalles finales.", diff --git a/src/assets/translations/fr/main.json b/src/assets/translations/fr/main.json index ac4c51a5a55..f920b7a8b03 100644 --- a/src/assets/translations/fr/main.json +++ b/src/assets/translations/fr/main.json @@ -751,13 +751,8 @@ "slowSwapBody": "Cet échange peut prendre quelques minutes pour se terminer.", "thorSmartContractWalletUnsupported": "Le réseau THORChain ne prend actuellement pas en charge les porte-monnaie pour contrats intelligents.", "intoAssetSymbolBody": "Vous pouvez procéder à cet échange, mais l'historique des transactions de réception en %{assetSymbol} est temporairement indisponible", - "recipientAddress": "Adresse du destinataire", "changeAddress": "Adresse de change", "changeAddressExplainer": "Lors de l'envoi de cryptomonnaies sur les réseaux basés sur UTXO, tous les fonds restants de votre transaction vous sont renvoyés à cette adresse.", - "customRecipientAddress": "Adresse de destinataire personnalisée", - "customRecipientAddressDescription": "Saisissez une adresse de destinataire personnalisée pour cet échange", - "thisIsYourCustomRecipientAddress": "Il s'agit de l'adresse personnalisée du destinataire", - "enterCustomRecipientAddress": "Saisissez l'adresse de destinataire personnalisée", "receiveAtLeast": "Recevez au moins", "tooltip": { "continueSwapping": "Continuer l'échange pour les détails finaux", diff --git a/src/assets/translations/ja/main.json b/src/assets/translations/ja/main.json index f2e1a5351fc..d13c728e3d2 100644 --- a/src/assets/translations/ja/main.json +++ b/src/assets/translations/ja/main.json @@ -751,13 +751,8 @@ "slowSwapBody": "このスワップが完了するまでに数分かかる場合があります。", "thorSmartContractWalletUnsupported": "THORChainネットワークは現在、スマートコントラクト ウォレットをサポートしていません。", "intoAssetSymbolBody": "この取引は続行できますが、%{assetSymbol} を受け取るための取引履歴は一時的に利用できなくなります", - "recipientAddress": "受信者のアドレス", "changeAddress": "アドレスを変更", "changeAddressExplainer": "UTXO ベースのネットワークで暗号通貨を送信すると、トランザクションで残った資金はこのアドレスに送り返されます。", - "customRecipientAddress": "カスタム受信者アドレス", - "customRecipientAddressDescription": "この取引のカスタム受信者アドレスを入力してください", - "thisIsYourCustomRecipientAddress": "これはカスタム受信者アドレスです", - "enterCustomRecipientAddress": "カスタム受信者アドレスを入力してください", "receiveAtLeast": "少なくとも受け取る", "tooltip": { "continueSwapping": "最終的な詳細について交換を続ける", diff --git a/src/assets/translations/pt/main.json b/src/assets/translations/pt/main.json index abece4b1d4f..3291681ce1d 100644 --- a/src/assets/translations/pt/main.json +++ b/src/assets/translations/pt/main.json @@ -751,13 +751,8 @@ "slowSwapBody": "Este swap pode levar alguns minutos para ser concluído.", "thorSmartContractWalletUnsupported": "A rede THORChain atualmente não oferece suporte a carteiras com contratos inteligentes.", "intoAssetSymbolBody": "Você pode continuar com esta negociação, mas o histórico de transações para receber %{assetSymbol} está temporariamente indisponível", - "recipientAddress": "Endereço de recebimento", "changeAddress": "Endereço de troco", "changeAddressExplainer": "Ao enviar criptomoedas em redes baseadas em UTXO, quaisquer fundos restantes da sua transação são enviados de volta para este endereço.", - "customRecipientAddress": "Endereço de recebimento personalizado", - "customRecipientAddressDescription": "Insira um endereço de recebimento personalizado para este trade", - "thisIsYourCustomRecipientAddress": "Este é o seu endereço personalizado para recebimento", - "enterCustomRecipientAddress": "Insira o endereço do destinatário personalizado", "receiveAtLeast": "Receba pelo menos", "tooltip": { "continueSwapping": "Continue negociando para mais detalhes", diff --git a/src/assets/translations/ru/main.json b/src/assets/translations/ru/main.json index 686798e658d..d09cfea9cec 100644 --- a/src/assets/translations/ru/main.json +++ b/src/assets/translations/ru/main.json @@ -751,13 +751,8 @@ "slowSwapBody": "Этот обмен может занять несколько минут.", "thorSmartContractWalletUnsupported": "В настоящее время сеть THORChain не поддерживает кошельки смарт-контрактов.", "intoAssetSymbolBody": "Вы можете продолжить эту сделку, но история операций по получению %{assetSymbol} временно недоступна", - "recipientAddress": "Адрес получателя", "changeAddress": "Изменить адрес", "changeAddressExplainer": "При отправке криптовалют в сетях на основе UTXO любые оставшиеся средства от вашей транзакции возвращаются вам на этот адрес.", - "customRecipientAddress": "Пользовательский адрес получателя", - "customRecipientAddressDescription": "Введите пользовательский адрес получателя для этой сделки", - "thisIsYourCustomRecipientAddress": "Это ваш пользовательский адрес получателя", - "enterCustomRecipientAddress": "Введите пользовательский адрес получателя", "receiveAtLeast": "Получите как минимум", "tooltip": { "continueSwapping": "Продолжайте обменивать для получения окончательных данных", diff --git a/src/assets/translations/tr/main.json b/src/assets/translations/tr/main.json index 3fd72f08b0c..f07464afe22 100644 --- a/src/assets/translations/tr/main.json +++ b/src/assets/translations/tr/main.json @@ -751,13 +751,8 @@ "slowSwapBody": "Bu takasın tamamlanması birkaç dakika sürebilir.", "thorSmartContractWalletUnsupported": "THORChain ağı şu anda akıllı sözleşme cüzdanlarını desteklemiyor.", "intoAssetSymbolBody": "Bu ticarete devam edebilirsiniz, ancak %{assetSymbol} almak için işlem geçmişi geçici olarak kullanılamıyor", - "recipientAddress": "Alıcı adresi", "changeAddress": "Adresi değiştir", "changeAddressExplainer": "UTXO tabanlı ağlar üzerinden kripto para gönderirken, işlemden kalan fonlar bu adrese geri gönderilir.", - "customRecipientAddress": "Özel alıcı adresi", - "customRecipientAddressDescription": "Bu takas için özel bir alıcı adresi girin", - "thisIsYourCustomRecipientAddress": "Bu sizin özel alıcı adresinizdir", - "enterCustomRecipientAddress": "Özel alıcı adresini girin", "receiveAtLeast": "En azdan al", "tooltip": { "continueSwapping": "Son detaylar için takasa devam edin", diff --git a/src/assets/translations/uk/main.json b/src/assets/translations/uk/main.json index e95e05a219a..1e6f8d38be8 100644 --- a/src/assets/translations/uk/main.json +++ b/src/assets/translations/uk/main.json @@ -751,13 +751,8 @@ "slowSwapBody": "Цей обмін може зайняти кілька хвилин.", "thorSmartContractWalletUnsupported": "Наразі мережа THORchain не підтримує гаманці смарт-контрактів.", "intoAssetSymbolBody": "Ви можете продовжити цю угоду, але історія транзакцій по отриманню %{assetSymbol} тимчасово недоступна", - "recipientAddress": "Адреса одержувача", "changeAddress": "Змінити адресу", "changeAddressExplainer": "При відправленні криптовалют у мережах на основі UTXO будь-які залишки коштів від вашої транзакції повертаються вам на цю адресу.", - "customRecipientAddress": "Користувацька адреса одержувача", - "customRecipientAddressDescription": "Введіть спеціальну адресу одержувача для цієї операції", - "thisIsYourCustomRecipientAddress": "Це ваша користувацька адреса одержувача", - "enterCustomRecipientAddress": "Введіть користувацьку адресу одержувача", "receiveAtLeast": "Отримаєте щонайменше", "tooltip": { "continueSwapping": "Продовжуйте обмін для отримання фінальних деталей", diff --git a/src/assets/translations/zh/main.json b/src/assets/translations/zh/main.json index a99d6e9a587..43248012e42 100644 --- a/src/assets/translations/zh/main.json +++ b/src/assets/translations/zh/main.json @@ -751,13 +751,8 @@ "slowSwapBody": "该兑换可能需要几分钟才能完成。", "thorSmartContractWalletUnsupported": "THORChain 网络目前不支持智能合约钱包。", "intoAssetSymbolBody": "你可以继续进行此交易,但接收 %{assetSymbol} 的交易历史记录暂时不可用", - "recipientAddress": "接收者地址", "changeAddress": "退款地址", "changeAddressExplainer": "在基于 UTXO 的网络上发送加密货币时,交易中未使用的余额将会通过此地址返回给您。", - "customRecipientAddress": "自定义接收者地址", - "customRecipientAddressDescription": "输入此交易的自定义接收者地址", - "thisIsYourCustomRecipientAddress": "这是您的自定义接收者地址", - "enterCustomRecipientAddress": "输入自定义接收者地址", "receiveAtLeast": "至少收到", "tooltip": { "continueSwapping": "继续交换以查看最终详情", diff --git a/src/components/MultiHopTrade/components/FiatRamps/FiatRampTradeFooter.tsx b/src/components/MultiHopTrade/components/FiatRamps/FiatRampTradeFooter.tsx index cb2fc73452d..2a616e4b220 100644 --- a/src/components/MultiHopTrade/components/FiatRamps/FiatRampTradeFooter.tsx +++ b/src/components/MultiHopTrade/components/FiatRamps/FiatRampTradeFooter.tsx @@ -8,7 +8,7 @@ import { useCallback, useMemo } from 'react' import { ButtonWalletPredicate } from '@/components/ButtonWalletPredicate/ButtonWalletPredicate' import { FiatRampAction } from '@/components/Modals/FiatRamps/FiatRampsCommon' import { RateGasRow } from '@/components/MultiHopTrade/components/RateGasRow' -import { SharedRecipientAddress } from '@/components/MultiHopTrade/components/SharedTradeInput/SharedRecipientAddress' +import { SharedTradeReceiveAddress } from '@/components/MultiHopTrade/components/SharedTradeInput/SharedTradeReceiveAddress' import { Protocol } from '@/components/MultiHopTrade/components/TradeInput/components/Protocol' import { useReceiveAddress } from '@/components/MultiHopTrade/hooks/useReceiveAddress' import { Text } from '@/components/Text' @@ -227,7 +227,7 @@ export const FiatRampTradeFooter = ({ width='full' > {direction === FiatRampAction.Buy && buyAsset && ( - <> - {renderedRecipientAddress} + {renderedReceiveAddress} ) @@ -588,9 +588,9 @@ export const LimitOrderInput = ({ limitPrice.buyAssetDenomination, marketPriceBuyAsset, sellAccountId, - isRecipientAddressEntryActive, + isReceiveAddressEntryActive, networkFeeUserCurrency, - renderedRecipientAddress, + renderedReceiveAddress, noExpand, isLimitOrderQuoteFetching, ]) diff --git a/src/components/MultiHopTrade/components/LimitOrder/hooks/useLimitOrderRecipientAddress.tsx b/src/components/MultiHopTrade/components/LimitOrder/hooks/useLimitOrderReceiveAddress.tsx similarity index 89% rename from src/components/MultiHopTrade/components/LimitOrder/hooks/useLimitOrderRecipientAddress.tsx rename to src/components/MultiHopTrade/components/LimitOrder/hooks/useLimitOrderReceiveAddress.tsx index 64c75b40d1e..e7981866f87 100644 --- a/src/components/MultiHopTrade/components/LimitOrder/hooks/useLimitOrderRecipientAddress.tsx +++ b/src/components/MultiHopTrade/components/LimitOrder/hooks/useLimitOrderReceiveAddress.tsx @@ -2,7 +2,7 @@ import type { Asset } from '@shapeshiftoss/types' import { useCallback, useMemo } from 'react' import type { Address } from 'viem' -import { SharedRecipientAddress } from '../../SharedTradeInput/SharedRecipientAddress' +import { SharedTradeReceiveAddress } from '../../SharedTradeInput/SharedTradeReceiveAddress' import { useIsManualReceiveAddressRequired } from '@/components/MultiHopTrade/hooks/useIsManualReceiveAddressRequired' import { useReceiveAddress } from '@/components/MultiHopTrade/hooks/useReceiveAddress' @@ -16,17 +16,17 @@ import { } from '@/state/slices/limitOrderInputSlice/selectors' import { useAppSelector } from '@/state/store' -type UseLimitOrderRecipientAddressProps = { +type UseLimitOrderReceiveAddressProps = { buyAsset: Asset buyAccountId: string | undefined sellAccountId: string | undefined } -export const useLimitOrderRecipientAddress = ({ +export const useLimitOrderReceiveAddress = ({ buyAsset, buyAccountId, sellAccountId, -}: UseLimitOrderRecipientAddressProps) => { +}: UseLimitOrderReceiveAddressProps) => { const manualReceiveAddress = useAppSelector(selectManualReceiveAddress) const isManualReceiveAddressValid = useAppSelector(selectIsManualReceiveAddressValid) const isManualReceiveAddressEditing = useAppSelector(selectIsManualReceiveAddressEditing) @@ -83,7 +83,7 @@ export const useLimitOrderRecipientAddress = ({ isWalletReceiveAddressLoading, }) - const isRecipientAddressEntryActive = useMemo(() => { + const isReceiveAddressEntryActive = useMemo(() => { return ( isManualReceiveAddressRequired || isManualReceiveAddressValidating || @@ -97,9 +97,9 @@ export const useLimitOrderRecipientAddress = ({ isManualReceiveAddressValidating, ]) - const renderedRecipientAddress = useMemo(() => { + const renderedReceiveAddress = useMemo(() => { return ( - const iconButtonHoverSx = { bg: 'gray.600' } -type ManualRecipientAddressLabelsProps = { +type ManualReceiveAddressLabelsProps = { buyAsset: Asset manualAddressEntryDescription: string | undefined } -const ManualRecipientAddressLabels = ({ +const ManualReceiveAddressLabels = ({ buyAsset, manualAddressEntryDescription, -}: ManualRecipientAddressLabelsProps) => { +}: ManualReceiveAddressLabelsProps) => { const translate = useTranslate() const wallet = useWallet().state.wallet const { isSnapInstalled } = useIsSnapInstalled() @@ -104,9 +104,9 @@ const ManualRecipientAddressLabels = ({ ) } -type SharedRecipientAddressProps = { +type SharedTradeReceiveAddressProps = { buyAsset: Asset - customRecipientAddressDescription?: string + customReceiveAddressDescription?: string isWalletReceiveAddressLoading: boolean manualAddressEntryDescription?: string manualReceiveAddress: string | undefined @@ -121,9 +121,9 @@ type SharedRecipientAddressProps = { onSubmit: (address: string) => void } -export const SharedRecipientAddress = ({ +export const SharedTradeReceiveAddress = ({ buyAsset, - customRecipientAddressDescription, + customReceiveAddressDescription, isWalletReceiveAddressLoading, manualAddressEntryDescription, manualReceiveAddress, @@ -136,7 +136,7 @@ export const SharedRecipientAddress = ({ onIsValidChange, onReset, onSubmit, -}: SharedRecipientAddressProps) => { +}: SharedTradeReceiveAddressProps) => { const translate = useTranslate() const { sellAssetAccountId } = useAccountIds() const receiveAddress = manualReceiveAddress ?? walletReceiveAddress @@ -176,8 +176,8 @@ export const SharedRecipientAddress = ({ const isCustomRecipientAddress = Boolean(manualReceiveAddress) const recipientAddressTranslation: TextPropTypes['translation'] = isCustomRecipientAddress - ? 'trade.customRecipientAddress' - : 'trade.recipientAddress' + ? 'trade.customReceiveAddress' + : 'trade.receiveAddress' const rules = useMemo( () => ({ @@ -266,7 +266,7 @@ export const SharedRecipientAddress = ({ return ( {shouldForceDisplayManualAddressEntry && ( - @@ -274,7 +274,7 @@ export const SharedRecipientAddress = ({ - {customRecipientAddressDescription && ( + {customReceiveAddressDescription && ( - {customRecipientAddressDescription} + {customReceiveAddressDescription} )} @@ -322,7 +322,7 @@ export const SharedRecipientAddress = ({ {isCustomRecipientAddress ? ( - + {middleEllipsis(receiveAddress ?? '')} @@ -331,9 +331,9 @@ export const SharedRecipientAddress = ({ ) : ( {middleEllipsis(receiveAddress ?? '')} - + = ({ - {maybeUtxoChangeAddress && ( diff --git a/src/components/MultiHopTrade/components/TradeConfirm/components/TradeConfirmSummary.tsx b/src/components/MultiHopTrade/components/TradeConfirm/components/TradeConfirmSummary.tsx index a169cd99b59..235cbc8fdd9 100644 --- a/src/components/MultiHopTrade/components/TradeConfirm/components/TradeConfirmSummary.tsx +++ b/src/components/MultiHopTrade/components/TradeConfirm/components/TradeConfirmSummary.tsx @@ -13,7 +13,7 @@ import { Amount } from '@/components/Amount/Amount' import { SwapperIcons } from '@/components/MultiHopTrade/components/SwapperIcons' import { parseAmountDisplayMeta } from '@/components/MultiHopTrade/helpers' import { usePriceImpact } from '@/components/MultiHopTrade/hooks/quoteValidation/usePriceImpact' -import { RecipientAddressRow } from '@/components/RecipientAddressRow' +import { ReceiveAddressRow } from '@/components/ReceiveAddressRow' import { Row } from '@/components/Row/Row' import { RawText, Text } from '@/components/Text' import { selectFeeAssetById } from '@/state/slices/selectors' @@ -165,9 +165,9 @@ export const TradeConfirmSummary = () => { /> - diff --git a/src/components/MultiHopTrade/components/TradeInput/components/ConfirmSummary.tsx b/src/components/MultiHopTrade/components/TradeInput/components/ConfirmSummary.tsx index 9c1d69da5b9..4929f1149bb 100644 --- a/src/components/MultiHopTrade/components/TradeInput/components/ConfirmSummary.tsx +++ b/src/components/MultiHopTrade/components/TradeInput/components/ConfirmSummary.tsx @@ -14,7 +14,7 @@ import { getQuoteRequestErrorTranslation } from '../getQuoteRequestErrorTranslat import { useTradeReceiveAddress } from '../hooks/useTradeReceiveAddress' import { MaxSlippage } from './MaxSlippage' import { Protocol } from './Protocol' -import { RecipientAddress } from './RecipientAddress' +import { ReceiveAddress } from './ReceiveAddress' import { SwapperIcons } from '@/components/MultiHopTrade/components/SwapperIcons' import { parseAmountDisplayMeta } from '@/components/MultiHopTrade/helpers' @@ -381,9 +381,9 @@ export const ConfirmSummary = ({ icon={swapperIcon} /> )} - { +}: ReceiveAddressProps) => { const dispatch = useAppDispatch() const { @@ -72,9 +72,9 @@ export const RecipientAddress = ({ ) return ( - { + receiveAddress, +}: ReceiveAddressRowProps) => { const translate = useTranslate() return ( - + - {middleEllipsis(recipientAddress)} + {middleEllipsis(receiveAddress)} From f1c123158618dc8b126600dd5a0e606b8070ce58 Mon Sep 17 00:00:00 2001 From: gomes <17035424+gomesalexandre@users.noreply.github.com> Date: Mon, 1 Dec 2025 12:05:31 +0300 Subject: [PATCH 2/2] feat: robots tackle last ones --- .../LimitOrder/components/LimitOrderInput.tsx | 2 +- .../SharedTradeReceiveAddress.tsx | 28 +++++++++---------- src/state/apis/limit-orders/limitOrderApi.ts | 6 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/MultiHopTrade/components/LimitOrder/components/LimitOrderInput.tsx b/src/components/MultiHopTrade/components/LimitOrder/components/LimitOrderInput.tsx index 5dcde5a3c37..fc81a59ac5e 100644 --- a/src/components/MultiHopTrade/components/LimitOrder/components/LimitOrderInput.tsx +++ b/src/components/MultiHopTrade/components/LimitOrder/components/LimitOrderInput.tsx @@ -202,7 +202,7 @@ export const LimitOrderInput = ({ affiliateBps: DEFAULT_FEE_BPS, sellAccountAddress, sellAmountCryptoBaseUnit, - recipientAddress: receiveAddress, + receiveAddress, } }, [ sellAmountCryptoBaseUnit, diff --git a/src/components/MultiHopTrade/components/SharedTradeInput/SharedTradeReceiveAddress.tsx b/src/components/MultiHopTrade/components/SharedTradeInput/SharedTradeReceiveAddress.tsx index 212b4d0ee89..3ce29a1e852 100644 --- a/src/components/MultiHopTrade/components/SharedTradeInput/SharedTradeReceiveAddress.tsx +++ b/src/components/MultiHopTrade/components/SharedTradeInput/SharedTradeReceiveAddress.tsx @@ -150,7 +150,7 @@ export const SharedTradeReceiveAddress = ({ const value = useWatch({ name: SendFormFields.Input }) const debouncedValue = useDebounce(value, 500) - const [isRecipientAddressEditing, setIsRecipientAddressEditing] = useState(false) + const [isReceiveAddressEditing, setIsReceiveAddressEditing] = useState(false) // If we have a valid manual receive address, set it in the form useEffect(() => { @@ -162,7 +162,7 @@ export const SharedTradeReceiveAddress = ({ }, [onIsValidatingChange, isValidating]) useEffect(() => { - if (!isRecipientAddressEditing) return + if (!isReceiveAddressEditing) return // minLength should catch this and make isValid false, but doesn't seem to on mount, even when manually triggering validation. if (!value?.length) { @@ -172,10 +172,10 @@ export const SharedTradeReceiveAddress = ({ // We only want to set this when editing. Failure to do so will catch the initial '' invalid value (because of the minLength: 1) // and prevent continuing with the trade, when there is no manual receive address onIsValidChange(isValid) - }, [isValid, onIsValidChange, isRecipientAddressEditing, value]) + }, [isValid, onIsValidChange, isReceiveAddressEditing, value]) - const isCustomRecipientAddress = Boolean(manualReceiveAddress) - const recipientAddressTranslation: TextPropTypes['translation'] = isCustomRecipientAddress + const isCustomReceiveAddress = Boolean(manualReceiveAddress) + const receiveAddressTranslation: TextPropTypes['translation'] = isCustomReceiveAddress ? 'trade.customReceiveAddress' : 'trade.receiveAddress' @@ -211,21 +211,21 @@ export const SharedTradeReceiveAddress = ({ [buyAssetAssetId, buyAssetChainId, onError], ) - const handleEditRecipientAddressClick = useCallback(() => { + const handleEditReceiveAddressClick = useCallback(() => { onEdit() - setIsRecipientAddressEditing(true) + setIsReceiveAddressEditing(true) }, [onEdit]) const handleCancelClick = useCallback(() => { onCancel() - setIsRecipientAddressEditing(false) + setIsReceiveAddressEditing(false) setFormValue(SendFormFields.Input, '') }, [onCancel, setFormValue]) const resetManualReceiveAddress = useCallback(() => { onReset() // Reset the form value itself, to avoid the user going from - // custom recipient -> cleared custom recipient -> custom recipient where the previously set custom recipient + // custom receive address -> cleared custom receive address -> custom receive address where the previously set custom receive address // would be displayed, wrongly hinting this is the default wallet address setFormValue(SendFormFields.Input, '') }, [onReset, setFormValue]) @@ -249,7 +249,7 @@ export const SharedTradeReceiveAddress = ({ if (isValidAddress) { onSubmit(debouncedValue) - setIsRecipientAddressEditing(false) + setIsReceiveAddressEditing(false) } } catch (error) { console.error('Error validating pasted address:', error) @@ -262,7 +262,7 @@ export const SharedTradeReceiveAddress = ({ } // The manual receive address input form - if (isRecipientAddressEditing || shouldForceDisplayManualAddressEntry) { + if (isReceiveAddressEditing || shouldForceDisplayManualAddressEntry) { return ( {shouldForceDisplayManualAddressEntry && ( @@ -318,10 +318,10 @@ export const SharedTradeReceiveAddress = ({ )} - + - {isCustomRecipientAddress ? ( + {isCustomReceiveAddress ? ( {middleEllipsis(receiveAddress ?? '')} @@ -338,7 +338,7 @@ export const SharedTradeReceiveAddress = ({ variant='ghost' minWidth={0} top='-1px' - onClick={handleEditRecipientAddressClick} + onClick={handleEditReceiveAddressClick} /> diff --git a/src/state/apis/limit-orders/limitOrderApi.ts b/src/state/apis/limit-orders/limitOrderApi.ts index b5ceb436f86..d6cbb106eb2 100644 --- a/src/state/apis/limit-orders/limitOrderApi.ts +++ b/src/state/apis/limit-orders/limitOrderApi.ts @@ -58,7 +58,7 @@ export type LimitOrderQuoteParams = { affiliateBps: string sellAccountAddress: Address | undefined sellAmountCryptoBaseUnit: string - recipientAddress: Address | undefined + receiveAddress: Address | undefined } export const limitOrderApi = createApi({ @@ -138,7 +138,7 @@ export const limitOrderApi = createApi({ affiliateBps, sellAccountAddress, sellAmountCryptoBaseUnit, - recipientAddress, + receiveAddress, } = params const config = getConfig() const baseUrl = config.VITE_COWSWAP_BASE_URL @@ -163,7 +163,7 @@ export const limitOrderApi = createApi({ buyToken: !isNativeEvmAsset(buyAssetId) ? (fromAssetId(buyAssetId).assetReference as Address) : COW_SWAP_NATIVE_ASSET_MARKER_ADDRESS, - receiver: recipientAddress, + receiver: receiveAddress, sellTokenBalance: SellTokenSource.ERC20, from: sellAccountAddress ?? zeroAddress, // Zero address used to enable quotes without wallet connected priceQuality: PriceQuality.OPTIMAL,