1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Preserve search query for "Swap from" and "Swap to" form fields, update content (#15758)

This commit is contained in:
Daniel 2022-09-08 18:31:56 +02:00 committed by GitHub
parent 2dbabac599
commit fe10c35464
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 35 additions and 191 deletions

View File

@ -3233,9 +3233,6 @@
"swap": {
"message": "Swap"
},
"swapAdvancedSlippageInfo": {
"message": "Wenn sich der Kurs zwischen der Aufgabe und der Bestätigung Ihres Auftrags ändert, nennt man das \"Slippage\". Ihr Swap wird automatisch storniert, wenn die Slippage Ihre Einstellung für die maximale Slippage überschreitet."
},
"swapAggregator": {
"message": "Aggregator"
},
@ -3399,9 +3396,6 @@
"swapQuoteDetails": {
"message": "Kursdetails"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Wenn sich der Kurs zwischen der Aufgabe und der Bestätigung Ihres Auftrags ändert, nennt man das \"Slippage\". Ihr Swap wird automatisch storniert, wenn die Slippage Ihre Einstellung für die \"Slippagetoleranz\" überschreitet."
},
"swapQuoteSource": {
"message": "Kursquelle"
},
@ -3432,9 +3426,6 @@
"swapReviewSwap": {
"message": "Swap überprüfen"
},
"swapSearchForAToken": {
"message": "Nach einem Token suchen"
},
"swapSelect": {
"message": "Auswählen"
},

View File

@ -3289,9 +3289,6 @@
"swap": {
"message": "Ανταλλαγή"
},
"swapAdvancedSlippageInfo": {
"message": "Εάν η τιμή αλλάζει μεταξύ της ώρας που τοποθετείται η παραγγελία σας και της επιβεβαίωσης, αυτό ονομάζεται \"ολίσθηση\". Η ανταλλαγή σας θα ακυρωθεί αυτόματα αν η ολίσθηση υπερβαίνει τη ρύθμιση \"ανοχή ολίσθησης\"."
},
"swapAggregator": {
"message": "Aggregator Ανταλλακτηρίων"
},
@ -3455,9 +3452,6 @@
"swapQuoteDetails": {
"message": "Λεπτομέρειες προσφοράς"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Εάν η τιμή αλλάζει μεταξύ της ώρας που τοποθετείται η παραγγελία σας και επιβεβαιώνεται ονομάζεται \"ολίσθηση\". Η ανταλλαγή σας θα ακυρωθεί αυτόματα αν η ολίσθηση υπερβαίνει τη ρύθμιση \"ανοχή ολίσθησης\"."
},
"swapQuoteSource": {
"message": "Πηγή προσφοράς"
},
@ -3488,9 +3482,6 @@
"swapReviewSwap": {
"message": "Επανεξέταση Ανταλλαγής"
},
"swapSearchForAToken": {
"message": "Αναζήτηση για ένα token"
},
"swapSelect": {
"message": "Επιλογή"
},

View File

@ -3470,9 +3470,6 @@
"swap": {
"message": "Swap"
},
"swapAdvancedSlippageInfo": {
"message": "If the price changes between the time your order is placed and confirmed its called “slippage”. Your swap will automatically cancel if slippage exceeds your “max slippage” setting."
},
"swapAggregator": {
"message": "Aggregator"
},
@ -3636,9 +3633,6 @@
"swapQuoteDetails": {
"message": "Quote details"
},
"swapQuoteDetailsSlippageInfo": {
"message": "If the price changes between the time your order is placed and confirmed its called \"slippage\". Your Swap will automatically cancel if slippage exceeds your \"slippage tolerance\" setting."
},
"swapQuoteSource": {
"message": "Quote source"
},
@ -3669,8 +3663,8 @@
"swapReviewSwap": {
"message": "Review swap"
},
"swapSearchForAToken": {
"message": "Search for a token"
"swapSearchNameOrAddress": {
"message": "Search name or paste address"
},
"swapSelect": {
"message": "Select"
@ -3691,6 +3685,9 @@
"message": "$1%",
"description": "$1 is the amount of % for slippage"
},
"swapSlippageTooltip": {
"message": "If the price changes between the time your order is placed and confirmed its called “slippage”. Your swap will automatically cancel if slippage exceeds your “slippage tolerance” setting."
},
"swapSource": {
"message": "Liquidity source"
},

View File

@ -3289,9 +3289,6 @@
"swap": {
"message": "Canjear"
},
"swapAdvancedSlippageInfo": {
"message": "Si el precio cambia entre el momento en que hace el pedido y cuando se confirma, se denomina “desfase”. El canje se cancelará automáticamente si el desfase supera lo establecido en la configuración “max slippage” (desfase máximo)."
},
"swapAggregator": {
"message": "Agregador"
},
@ -3455,9 +3452,6 @@
"swapQuoteDetails": {
"message": "Detalles de cotización"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Si el precio cambia entre el momento en que hace el pedido y cuando se confirma, se denomina \"desfase\". El canje se cancelará automáticamente si el desfase supera lo establecido en la configuración \"tolerancia de desfase\"."
},
"swapQuoteSource": {
"message": "Fuente de la cotización"
},
@ -3488,9 +3482,6 @@
"swapReviewSwap": {
"message": "Revisar canje"
},
"swapSearchForAToken": {
"message": "Buscar un token"
},
"swapSelect": {
"message": "Seleccionar"
},

View File

@ -2615,9 +2615,6 @@
"swap": {
"message": "Canjear"
},
"swapAdvancedSlippageInfo": {
"message": "Si el precio cambia entre el momento en que hace el pedido y cuando se confirma, se denomina “desfase”. El canje se cancelará automáticamente si el desfase supera lo establecido en la configuración “max slippage” (desfase máximo)."
},
"swapAggregator": {
"message": "Agregador"
},
@ -2773,9 +2770,6 @@
"swapQuoteDetails": {
"message": "Detalles de cotización"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Si el precio cambia entre el momento en que hace el pedido y cuando se confirma, se denomina \"desfase\". El canje se cancelará automáticamente si el desfase supera lo establecido en la configuración de la \"tolerancia de desfase\"."
},
"swapQuoteSource": {
"message": "Fuente de la cotización"
},
@ -2806,9 +2800,6 @@
"swapReviewSwap": {
"message": "Revisar canje"
},
"swapSearchForAToken": {
"message": "Buscar un token"
},
"swapSelect": {
"message": "Seleccionar"
},

View File

@ -3289,9 +3289,6 @@
"swap": {
"message": "Swap"
},
"swapAdvancedSlippageInfo": {
"message": "Si le prix fluctue entre le passage de votre ordre et sa confirmation, on parle alors dun « effet de glissement » (slippage). Votre swap sera automatiquement annulé si ce phénomène dépasse votre paramètre de « glissement maximal »."
},
"swapAggregator": {
"message": "Agrégateur"
},
@ -3455,9 +3452,6 @@
"swapQuoteDetails": {
"message": "Détails de la cotation"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Si le prix fluctue entre le passage de votre ordre et sa confirmation, on parle alors dun « effet de glissement » (slippage). Votre swap sera automatiquement annulé si ce phénomène dépasse votre paramètre de « tolérance de glissement »."
},
"swapQuoteSource": {
"message": "Origine de la cotation"
},
@ -3488,9 +3482,6 @@
"swapReviewSwap": {
"message": "Vérifier le swap"
},
"swapSearchForAToken": {
"message": "Rechercher un jeton"
},
"swapSelect": {
"message": "Sélectionner"
},

View File

@ -3289,9 +3289,6 @@
"swap": {
"message": "स्वैप करें"
},
"swapAdvancedSlippageInfo": {
"message": "यदि आपके ऑर्डर किए जाने और पुष्टि किए जाने के समय के बीच मूल्य में परिवर्तन होता है, तो इसे “स्लिपेज” कहा जाता है। यदि आपका स्लिपेज आपकी “अधिकतम स्लिपेज” सेटिंग से अधिक हो जाता है, तो आपका स्वैप स्वतः रद्द हो जाएगा।"
},
"swapAggregator": {
"message": "एग्रीगेटर"
},
@ -3455,9 +3452,6 @@
"swapQuoteDetails": {
"message": "उद्धरण का विवरण"
},
"swapQuoteDetailsSlippageInfo": {
"message": "यदि आपके ऑर्डर किए जाने और पुष्टि किए जाने के समय के बीच मूल्य में परिवर्तन होता है, तो इसे \"स्लिपेज\" कहा जाता है। यदि स्लिपेज आपकी \"स्लिपेज टॉलरेंस\" सेटिंग से अधिक हो जाता है, तो आपका स्वैप स्वतः रद्द हो जाएगा।"
},
"swapQuoteSource": {
"message": "उद्धरण का स्रोत"
},
@ -3488,9 +3482,6 @@
"swapReviewSwap": {
"message": "स्वैप की समीक्षा करें"
},
"swapSearchForAToken": {
"message": "एक टोकन की खोज करें"
},
"swapSelect": {
"message": "चयन करें"
},

View File

@ -3289,9 +3289,6 @@
"swap": {
"message": "Pertukaran"
},
"swapAdvancedSlippageInfo": {
"message": "Jika harga berubah antara waktu penempatan dan konfirmasi order Anda, ini disebut “slippage”. Swap akan otomatis dibatalkan jika slippage melebihi pengaturan “slippage maks”."
},
"swapAggregator": {
"message": "Agregator"
},
@ -3455,9 +3452,6 @@
"swapQuoteDetails": {
"message": "Detail kuotasi"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Jika harga berubah antara waktu penempatan dan konfirmasi order Anda, ini disebut \"slippage\". Swap Anda akan otomatis dibatalkan jika slippage melebihi pengaturan \"toleransi slippage\"."
},
"swapQuoteSource": {
"message": "Sumber kuotasi"
},
@ -3488,9 +3482,6 @@
"swapReviewSwap": {
"message": "Tinjau Swap"
},
"swapSearchForAToken": {
"message": "Cari token"
},
"swapSelect": {
"message": "Pilih"
},

View File

@ -1355,9 +1355,6 @@
"swap": {
"message": "Scambia"
},
"swapAdvancedSlippageInfo": {
"message": "Si chiama “slippage” la differenza tra il prezzo quando il tuo ordine viene inserito e quando viene confermato. Lo scambio sarà annullato automaticamente se lo slippage supera il “massimo slippage” impostato."
},
"swapAggregator": {
"message": "Aggregatore"
},
@ -1445,9 +1442,6 @@
"swapQuoteDetails": {
"message": "Dettagli quotazione"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Si chiama \"slippage\" la differenza tra il prezzo quando il tuo ordine viene inserito e quando viene confermato. Lo scambio sarà annullato automaticamente se lo slippage supera il \"massimo slippage\" impostato."
},
"swapQuoteSource": {
"message": "Sorgente della quota"
},
@ -1478,9 +1472,6 @@
"swapReviewSwap": {
"message": "Verifica Scambio"
},
"swapSearchForAToken": {
"message": "Cerca un token"
},
"swapSelect": {
"message": "Selezione"
},

View File

@ -3289,9 +3289,6 @@
"swap": {
"message": "スワップ"
},
"swapAdvancedSlippageInfo": {
"message": "注文した時点と注文が承認された時点で価格が変わることを 「スリッページ」 と呼びます。スリッページが「最大スリッページ」設定を超える場合、スワップは自動的にキャンセルされます。"
},
"swapAggregator": {
"message": "アグリゲーター"
},
@ -3455,9 +3452,6 @@
"swapQuoteDetails": {
"message": "見積もりの詳細"
},
"swapQuoteDetailsSlippageInfo": {
"message": "注文した時点と注文が承認された時点で価格が変わることを「スリッページ」と呼びます。スリッページが「最大スリッページ」設定を超える場合、スワップは自動的にキャンセルされます。"
},
"swapQuoteSource": {
"message": "見積もりのソース"
},
@ -3488,9 +3482,6 @@
"swapReviewSwap": {
"message": "スワップの確認"
},
"swapSearchForAToken": {
"message": "トークンの検索"
},
"swapSelect": {
"message": "選択"
},

View File

@ -3289,9 +3289,6 @@
"swap": {
"message": "스왑"
},
"swapAdvancedSlippageInfo": {
"message": "주문 시점과 확인 시점 사이에 가격이 변동되는 현상을 '슬리패지'라고 합니다. 슬리패지가 '최대 슬리패지' 설정을 초과하면 스왑이 자동으로 취소됩니다."
},
"swapAggregator": {
"message": "애그리게이터"
},
@ -3455,9 +3452,6 @@
"swapQuoteDetails": {
"message": "견적 세부 정보"
},
"swapQuoteDetailsSlippageInfo": {
"message": "주문 시점과 확인 시점 사이에 가격이 변동되는 현상을 \"슬리패지\"라고 합니다. 슬리패지가 \"최대 슬리패지\" 설정을 초과하면 스왑이 자동으로 취소됩니다."
},
"swapQuoteSource": {
"message": "견적 소스"
},
@ -3488,9 +3482,6 @@
"swapReviewSwap": {
"message": "스왑 검토"
},
"swapSearchForAToken": {
"message": "토큰 검색"
},
"swapSelect": {
"message": "선택"
},

View File

@ -1707,9 +1707,6 @@
"swap": {
"message": "I-swap"
},
"swapAdvancedSlippageInfo": {
"message": "Kung magbabago ang presyo sa pagitan ng oras ng pag-order mo at sa oras na nakumpirma ito, tinatawag itong “slippage.” Awtomatikong makakansela ang iyong pag-swap kung lalampas ang slippage sa iyong setting na “max slippage”."
},
"swapAggregator": {
"message": "Aggregator"
},
@ -1833,9 +1830,6 @@
"swapQuoteDetails": {
"message": "Mga detalye ng quote"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Kung magbabago ang presyo sa pagitan ng oras ng pag-order mo at sa oras na nakumpirma ito, tinatawag itong \"slippage\". Awtomatikong makakansela ang iyong Pag-swap kung lalampas ang slippage sa iyong setting na \"tolerance ng slippage.\""
},
"swapQuoteSource": {
"message": "Pinagkunan ng quote"
},
@ -1866,9 +1860,6 @@
"swapReviewSwap": {
"message": "Suriin ang Pag-swap"
},
"swapSearchForAToken": {
"message": "Maghanap ng token"
},
"swapSelect": {
"message": "Piliin"
},

View File

@ -3289,9 +3289,6 @@
"swap": {
"message": "Swap"
},
"swapAdvancedSlippageInfo": {
"message": "Se o preço varia entre o momento em que a sua ordem é efetuada e o momento em que é confirmada, isso recebe o nome de \"slippage\". Sua troca será automaticamente cancelada se o slippage exceder a sua configuração de \"slippage máximo\"."
},
"swapAggregator": {
"message": "Agregador"
},
@ -3455,9 +3452,6 @@
"swapQuoteDetails": {
"message": "Detalhes da cotação"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Se o preço varia entre o momento em que a sua ordem é efetuada e o momento em que é confirmada, isso recebe o nome de \"slippage\". Sua troca será automaticamente cancelada se o slippage for superior à configuração de \"tolerância a slippage\"."
},
"swapQuoteSource": {
"message": "Fonte da cotação"
},
@ -3488,9 +3482,6 @@
"swapReviewSwap": {
"message": "Revisar troca"
},
"swapSearchForAToken": {
"message": "Pesquisar um token"
},
"swapSelect": {
"message": "Selecione"
},

View File

@ -2599,9 +2599,6 @@
"swap": {
"message": "Trocar"
},
"swapAdvancedSlippageInfo": {
"message": "Se o preço varia entre o momento em que a sua ordem é efetuada e o momento em que é confirmada, isso recebe o nome de \"slippage\". Sua troca será automaticamente cancelada se o slippage exceder a sua configuração de \"slippage máximo\"."
},
"swapAggregator": {
"message": "Agregador"
},
@ -2757,9 +2754,6 @@
"swapQuoteDetails": {
"message": "Detalhes da cotação"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Se o preço varia entre o momento em que a sua ordem é efetuada e o momento em que é confirmada, isso recebe o nome de \"slippage\". Sua troca será automaticamente cancelada se o slippage for superior à configuração de \"tolerância a slippage\"."
},
"swapQuoteSource": {
"message": "Fonte da cotação"
},
@ -2790,9 +2784,6 @@
"swapReviewSwap": {
"message": "Revisar troca"
},
"swapSearchForAToken": {
"message": "Buscar um token"
},
"swapSelect": {
"message": "Selecione"
},

View File

@ -3289,9 +3289,6 @@
"swap": {
"message": "Обмен"
},
"swapAdvancedSlippageInfo": {
"message": "Изменение цены в период между размещением заказа и подтверждением называется проскальзыванием. Ваш обмен будет автоматически отменен, если проскальзывание превысит вашу настройку «максимального проскальзывания»."
},
"swapAggregator": {
"message": "Агрегатор"
},
@ -3455,9 +3452,6 @@
"swapQuoteDetails": {
"message": "Свдения о котировке"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Изменение цены в период между размещением заказа и подтверждением называется проскальзыванием. Обмен будет автоматически отменен, если фактическое проскальзывание превысит установленный «допуск проскальзывания»."
},
"swapQuoteSource": {
"message": "Источник котировки"
},
@ -3488,9 +3482,6 @@
"swapReviewSwap": {
"message": "Проверить обмен"
},
"swapSearchForAToken": {
"message": "Поиск токена"
},
"swapSelect": {
"message": "Выбрать"
},

View File

@ -3289,9 +3289,6 @@
"swap": {
"message": "I-swap"
},
"swapAdvancedSlippageInfo": {
"message": "Kung magbabago ang presyo sa pagitan ng oras ng pag-order mo at sa oras na nakumpirma ito, tinatawag itong “slippage”. Awtomatikong makakansela ang iyong pag-swap kung lalampas ang slippage sa iyong setting na “max slippage”."
},
"swapAggregator": {
"message": "Aggregator"
},
@ -3455,9 +3452,6 @@
"swapQuoteDetails": {
"message": "Mga detalye ng quote"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Kung magbabago ang presyo sa pagitan ng oras ng pag-order mo at sa oras na nakumpirma ito, tinatawag itong \"slippage\". Awtomatikong makakansela ang iyong Pag-swap kung lalampas ang slippage sa iyong setting na \"max slippage\"."
},
"swapQuoteSource": {
"message": "Pinagkunan ng quote"
},
@ -3488,9 +3482,6 @@
"swapReviewSwap": {
"message": "I-review ang Pag-swap"
},
"swapSearchForAToken": {
"message": "Maghanap ng token"
},
"swapSelect": {
"message": "Piliin"
},

View File

@ -3289,9 +3289,6 @@
"swap": {
"message": "Takas"
},
"swapAdvancedSlippageInfo": {
"message": "Emrinizin verildiği ve onaylandığı zamanlar arasında fiyat farkı oluşursa buna \"fark\" denir. Fark, \"maks. fark\" ayarınızı aşarsa takas işleminiz otomatik olarak iptal edilir."
},
"swapAggregator": {
"message": "Toplayıcı"
},
@ -3455,9 +3452,6 @@
"swapQuoteDetails": {
"message": "Teklif ayrıntıları"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Emrinizin verildiği ve onaylandığı zamanlar arasında fiyat farkı oluşursa buna \"fark\" denir. Fark, \"fark toleransı\" ayarınızı aşarsa Takas işleminiz otomatik olarak iptal edilir."
},
"swapQuoteSource": {
"message": "Teklif kaynağı"
},
@ -3488,9 +3482,6 @@
"swapReviewSwap": {
"message": "Takası İncele"
},
"swapSearchForAToken": {
"message": "Bir token ara"
},
"swapSelect": {
"message": "Seç"
},

View File

@ -3289,9 +3289,6 @@
"swap": {
"message": "Hoán đổi"
},
"swapAdvancedSlippageInfo": {
"message": "Khi giá giữa thời điểm đặt lệnh và thời điểm xác nhận lệnh thay đổi, hiện tượng này được gọi là “trượt giá”. Giao dịch hoán đổi của bạn sẽ tự động hủy nếu mức trượt giá vượt quá “mức trượt giá tối đa” đã cài đặt."
},
"swapAggregator": {
"message": "Trình tổng hợp"
},
@ -3455,9 +3452,6 @@
"swapQuoteDetails": {
"message": "Chi tiết báo giá"
},
"swapQuoteDetailsSlippageInfo": {
"message": "Khi giá giữa thời điểm đặt lệnh và thời điểm xác nhận lệnh thay đổi, hiện tượng này được gọi là \"trượt giá\". Giao dịch hoán đổi của bạn sẽ tự động hủy nếu mức trượt giá vượt quá \"mức trượt giá cho phép\" đã đặt."
},
"swapQuoteSource": {
"message": "Nguồn báo giá"
},
@ -3488,9 +3482,6 @@
"swapReviewSwap": {
"message": "Xem lại giao dịch hoán đổi"
},
"swapSearchForAToken": {
"message": "Tìm kiếm token"
},
"swapSelect": {
"message": "Chọn"
},

View File

@ -3299,9 +3299,6 @@
"swap": {
"message": "交换"
},
"swapAdvancedSlippageInfo": {
"message": "如果在您下订单和确认订单之间价格发生了变化,这就叫做“滑点”。如果滑点超过您的“最大滑点”设置,您的交换将自动取消。"
},
"swapAggregator": {
"message": "聚合器"
},
@ -3465,9 +3462,6 @@
"swapQuoteDetails": {
"message": "报价详情"
},
"swapQuoteDetailsSlippageInfo": {
"message": "如果在您下订单和确认订单之间价格发生了变化,这就叫做“滑点”。如果滑点超过您的“最大滑点”设置,您的交换将自动取消。"
},
"swapQuoteSource": {
"message": "报价来源"
},
@ -3498,9 +3492,6 @@
"swapReviewSwap": {
"message": "审查交换"
},
"swapSearchForAToken": {
"message": "搜索代币"
},
"swapSelect": {
"message": "选择"
},

View File

@ -2563,9 +2563,6 @@
"swap": {
"message": "兑换 Swap"
},
"swapAdvancedSlippageInfo": {
"message": "如果价格在您下单和确认之间发生变化,这就叫做“滑点”。如果滑点超过您的“最大滑点”设置,您的的兑换将自动取消。"
},
"swapAggregator": {
"message": "聚合商"
},
@ -2721,9 +2718,6 @@
"swapQuoteDetails": {
"message": "报价详情"
},
"swapQuoteDetailsSlippageInfo": {
"message": "如果在您下订单和确认订单之间的价格发生了变化,这就叫做\"滑点\"。如果滑点超过您的\"最大滑点\"设置,您的兑换将自动取消。"
},
"swapQuoteSource": {
"message": "报价来源"
},
@ -2754,9 +2748,6 @@
"swapReviewSwap": {
"message": "审查交换"
},
"swapSearchForAToken": {
"message": "搜索代币"
},
"swapSelect": {
"message": "选择"
},

View File

@ -39,8 +39,13 @@ describe('Swap Eth for another Token', function () {
await driver.clickElement(
'[class="dropdown-search-list__closed-primary-label dropdown-search-list__select-default"]',
);
await driver.clickElement('[placeholder="Search for a token"]');
await driver.fill('[placeholder="Search for a token"]', 'DAI');
await driver.clickElement(
'[placeholder="Search name or paste address"]',
);
await driver.fill(
'[placeholder="Search name or paste address"]',
'DAI',
);
await driver.waitForSelector(
'[class="searchable-item-list__primary-label"]',
);

View File

@ -750,7 +750,6 @@ export default function BuildQuote({
<DropdownSearchList
startingItem={selectedToToken}
itemsToSearch={tokensToSearchSwapTo}
searchPlaceholderText={t('swapSearchForAToken')}
fuseSearchKeys={fuseSearchKeys}
selectPlaceHolderText={t('swapSelectAToken')}
maxListItems={30}

View File

@ -56,6 +56,7 @@ export default function DropdownSearchList({
const [isImportTokenModalOpen, setIsImportTokenModalOpen] = useState(false);
const [selectedItem, setSelectedItem] = useState(startingItem);
const [tokenForImport, setTokenForImport] = useState(null);
const [searchQuery, setSearchQuery] = useState('');
const hardwareWalletUsed = useSelector(isHardwareWallet);
const hardwareWalletType = useSelector(getHardwareWalletType);
@ -214,7 +215,7 @@ export default function DropdownSearchList({
<>
<SearchableItemList
itemsToSearch={loading ? [] : itemsToSearch}
Placeholder={({ searchQuery }) =>
Placeholder={() =>
loading ? (
<div className="dropdown-search-list__loading-item">
<PulseLoader />
@ -263,7 +264,7 @@ export default function DropdownSearchList({
</div>
)
}
searchPlaceholderText={t('swapSearchForAToken')}
searchPlaceholderText={t('swapSearchNameOrAddress')}
fuseSearchKeys={fuseSearchKeys}
defaultToAll={defaultToAll}
onClickItem={onClickItem}
@ -280,6 +281,8 @@ export default function DropdownSearchList({
hideItemIf={hideItemIf}
listContainerClassName={listContainerClassName}
shouldSearchForImports={shouldSearchForImports}
searchQuery={searchQuery}
setSearchQuery={setSearchQuery}
/>
<div
className="dropdown-search-list__close-area"

View File

@ -1,4 +1,4 @@
import React, { useState, useEffect, useRef } from 'react';
import React, { useEffect, useRef } from 'react';
import { useSelector } from 'react-redux';
import PropTypes from 'prop-types';
import Fuse from 'fuse.js';
@ -25,9 +25,10 @@ export default function ListItemSearch({
searchPlaceholderText,
defaultToAll,
shouldSearchForImports,
searchQuery,
setSearchQuery,
}) {
const fuseRef = useRef();
const [searchQuery, setSearchQuery] = useState('');
const chainId = useSelector(getCurrentChainId);
/**
@ -127,4 +128,6 @@ ListItemSearch.propTypes = {
searchPlaceholderText: PropTypes.string,
defaultToAll: PropTypes.bool,
shouldSearchForImports: PropTypes.bool,
searchQuery: PropTypes.func,
setSearchQuery: PropTypes.func,
};

View File

@ -19,6 +19,8 @@ export default function SearchableItemList({
hideItemIf,
listContainerClassName,
shouldSearchForImports,
searchQuery,
setSearchQuery,
}) {
const itemListRef = useRef();
@ -27,10 +29,12 @@ export default function SearchableItemList({
}, [defaultToAll, itemsToSearch]);
const [results, setResults] = useState(initialResultsState);
useEffect(() => {
setResults(initialResultsState);
if (!searchQuery) {
// Only if there is no searchQuery we want to show all tokens.
setResults(initialResultsState);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [initialResultsState.length]);
const [searchQuery, setSearchQuery] = useState('');
}, [initialResultsState.length, searchQuery]);
return (
<div className={className}>
@ -48,6 +52,8 @@ export default function SearchableItemList({
searchPlaceholderText={searchPlaceholderText}
defaultToAll={defaultToAll}
shouldSearchForImports={shouldSearchForImports}
searchQuery={searchQuery}
setSearchQuery={setSearchQuery}
/>
<ItemList
searchQuery={searchQuery}
@ -87,4 +93,6 @@ SearchableItemList.propTypes = {
hideItemIf: PropTypes.func,
listContainerClassName: PropTypes.string,
shouldSearchForImports: PropTypes.bool,
searchQuery: PropTypes.func,
setSearchQuery: PropTypes.func,
};

View File

@ -38,7 +38,7 @@ const QuoteDetails = ({
{t('swapMaxSlippage')}
<InfoTooltip
position="bottom"
contentText={t('swapQuoteDetailsSlippageInfo')}
contentText={t('swapSlippageTooltip')}
/>
</div>
<div className="quote-details__detail-content">{`${slippage}%`}</div>

View File

@ -112,7 +112,7 @@ export default function SlippageButtons({
</div>
<InfoTooltip
position="top"
contentText={t('swapAdvancedSlippageInfo')}
contentText={t('swapSlippageTooltip')}
/>
</div>
<ButtonGroup