Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Content update for Swaps #7960

Merged
merged 7 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions app/components/UI/Swaps/QuotesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -1941,9 +1941,9 @@ function SwapsQuotesView({
savings={isSaving}
>
<QuotesSummary.HeaderText style={styles.bestQuoteText} bold>
{isSaving
? strings('swaps.savings')
: strings('swaps.using_best_quote')}
{`${strings('swaps.n_quotes', {
numberOfQuotes: allQuotes.length,
})} `}
</QuotesSummary.HeaderText>
{allQuotes.length > 1 && (
<TouchableOpacity
Expand Down Expand Up @@ -2218,10 +2218,6 @@ function SwapsQuotesView({
title={strings('swaps.metamask_swap_fee')}
body={
<Text style={styles.text}>
{strings('swaps.fee_text.get_the')}{' '}
<Text bold>{strings('swaps.fee_text.best_price')}</Text>{' '}
{strings('swaps.fee_text.from_the')}{' '}
<Text bold>{strings('swaps.fee_text.top_liquidity')}</Text>{' '}
{selectedQuote && selectedQuote?.fee > 0
? strings('swaps.fee_text.fee_is_applied', {
fee: `${selectedQuote.fee}%`,
Expand Down
30 changes: 1 addition & 29 deletions app/components/UI/Swaps/components/QuotesModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,6 @@ const createStyles = (colors, shadows) =>
red: {
color: colors.error.default,
},
bestBadge: {
flexDirection: 'row',
},
bestBadgeWrapper: {
paddingVertical: 0,
paddingHorizontal: 8,
backgroundColor: colors.primary.default,
borderRadius: 4,
},
bestBadgeText: {
color: colors.primary.inverse,
},
transparent: {
opacity: 0,
},
Expand Down Expand Up @@ -436,23 +424,7 @@ function QuotesModal({
</Text>
</View>
<View style={styles.columnValue}>
{index === 0 ? (
showOverallValue ? (
<View style={styles.bestBadge}>
<View style={styles.bestBadgeWrapper}>
<Text
bold
small
style={styles.bestBadgeText}
>
{strings('swaps.best')}
</Text>
</View>
</View>
) : (
<Text> - </Text>
)
) : showOverallValue ? (
{showOverallValue ? (
<Text primary style={styles.red}>
-
{weiToFiat(
Expand Down
12 changes: 0 additions & 12 deletions app/components/UI/Swaps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import {
} from './utils';
import { getSwapsAmountNavbar } from '../Navbar';

import Onboarding from './components/Onboarding';
import useModalHandler from '../../Base/hooks/useModalHandler';
import Text from '../../Base/Text';
import Keypad from '../../Base/Keypad';
Expand Down Expand Up @@ -649,17 +648,6 @@ function SwapsAmountView({
const disabledView =
!destinationTokenHasEnoughOcurrances && !hasDismissedTokenAlert;

if (!userHasOnboarded) {
return (
<ScreenView
style={styles.container}
contentContainerStyle={styles.screen}
>
<Onboarding setHasOnboarded={setHasOnboarded} />
</ScreenView>
);
}

return (
<ScreenView
style={styles.container}
Expand Down
2 changes: 1 addition & 1 deletion app/reducers/swaps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export const swapsTopAssetsSelector = createSelector(
// * Reducer
export const initialState = {
isLive: true, // TODO: should we remove it?
hasOnboarded: false,
hasOnboarded: true, // TODO: Once we have updated UI / content for the modal, we should enable it again.

1: {
isLive: true,
Expand Down
2 changes: 1 addition & 1 deletion e2e/specs/swaps/swap-action-regression.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Regression } from '../../tags';
const fixtureServer = new FixtureServer();

describe(Regression('Multiple Swaps from Actions'), () => {
let swapOnboarded = false;
let swapOnboarded = true; // TODO: Set it to false once we show the onboarding page again.
beforeAll(async () => {
await TestHelpers.reverseServerPort();
const fixture = new FixtureBuilder()
Expand Down
2 changes: 1 addition & 1 deletion e2e/specs/swaps/swap-action-smoke.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Smoke } from '../../tags';
const fixtureServer = new FixtureServer();

describe(Smoke('Swap from Actions'), () => {
let swapOnboarded = false;
let swapOnboarded = true; // TODO: Set it to false once we show the onboarding page again.
beforeAll(async () => {
await TestHelpers.reverseServerPort();
const fixture = new FixtureBuilder()
Expand Down
2 changes: 1 addition & 1 deletion e2e/specs/swaps/swap-token-chart.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { Regression } from '../../tags';
const fixtureServer = new FixtureServer();

describe(Regression('Swap from Token view'), () => {
const swapOnboarded = false;
const swapOnboarded = true; // TODO: Set it to false once we show the onboarding page again.
beforeAll(async () => {
await TestHelpers.reverseServerPort();
const fixture = new FixtureBuilder()
Expand Down
5 changes: 0 additions & 5 deletions locales/languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,6 @@
"i_understand": "Ich verstehe",
"quotes_expire_in": "Angebote laufen ab in",
"saving": "Speichervorgang",
"using_best_quote": "Nutzen des besten Angebots",
"view_details": "Detail ansehen",
"estimated_gas_fee": "Geschätzte Gas-Gebühr",
"max_gas_fee": "Maximale Gas-Gebühr",
Expand All @@ -2165,10 +2164,6 @@
"completed_swap": "Tauschen!",
"metamask_swap_fee": "MetaMask-Tauschgebühr",
"fee_text": {
"get_the": "Sichern Sie sich den",
"best_price": "besten Preis",
"from_the": "von den",
"top_liquidity": "besten Liquiditätsquellen zu jeder Zeit.",
"fee_is_applied": "Die Gebühr von {{fee}} ist automatisch in diesem Angebot enthalten. Sie zahlen sie als Gegenleistung für eine Lizenz zur Nutzung der Software von MetaMask zur Aggregation von Liquiditätsanbieterinformationen.",
"fee_is_not_applied": "MetaMask berechnet in diesem Angebot keine zusätzliche Gebühr."
},
Expand Down
5 changes: 0 additions & 5 deletions locales/languages/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,6 @@
"i_understand": "Κατανοώ",
"quotes_expire_in": "Οι προσφορές λήγουν σε",
"saving": "Αποθήκευση",
"using_best_quote": "Χρήση της καλύτερης προσφοράς",
"view_details": "Δείτε λεπτομέρειες",
"estimated_gas_fee": "Εκτιμώμενο τέλος συναλλαγής",
"max_gas_fee": "Μέγιστο τέλος συναλλαγής",
Expand All @@ -2165,10 +2164,6 @@
"completed_swap": "Ανταλλαγή!",
"metamask_swap_fee": "Χρέωση ανταλλαγής στο MetaMask",
"fee_text": {
"get_the": "Πάρτε την",
"best_price": "καλύτερη τιμή",
"from_the": "από τις",
"top_liquidity": "κορυφαίες πηγές ρευστότητας κάθε φορά.",
"fee_is_applied": "Μια χρέωση {{fee}} συνυπολογίζεται αυτόματα σε αυτή την προσφορά. Την καταβάλλετε ως αντάλλαγμα για την άδεια χρήσης του λογισμικού συγκέντρωσης πληροφοριών για τους παρόχους ρευστότητας του MetaMask.",
"fee_is_not_applied": "Το MetaMask δεν περιλαμβάνει πρόσθετη χρέωση για αυτήν την προσφορά."
},
Expand Down
8 changes: 2 additions & 6 deletions locales/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2162,7 +2162,7 @@
"i_understand": "I understand",
"quotes_expire_in": "Quotes expire in",
"saving": "Saving",
"using_best_quote": "Using the best quote",
"n_quotes": "{{numberOfQuotes}} quotes",
"view_details": "View details",
"estimated_gas_fee": "Estimated gas fee",
"max_gas_fee": "Max gas fee",
Expand All @@ -2175,10 +2175,6 @@
"completed_swap": "Swap!",
"metamask_swap_fee": "MetaMask Swap fee",
"fee_text": {
"get_the": "Get the",
"best_price": "best price",
"from_the": "from the",
"top_liquidity": "top liquidity sources every time.",
"fee_is_applied": "The fee of {{fee}} is automatically factored into this quote. You pay it in exchange for a license to use MetaMask's liquidity provider information aggregation software.",
"fee_is_not_applied": "MetaMask does not include an additional fee in this quote."
},
Expand Down Expand Up @@ -2211,7 +2207,7 @@
"quote_source_agg": {
"1": "This quote comes from an",
"2": "aggregator",
"3": "which finds the best price by splitting your order between different decentralized exchanges."
"3": "which compares prices and splits your order between different decentralized exchanges."
},
"quote_source_cnt": {
"1": "This quote comes directly from a",
Expand Down
5 changes: 0 additions & 5 deletions locales/languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,6 @@
"i_understand": "Comprendo",
"quotes_expire_in": "Las cotizaciones vencen en",
"saving": "Ahorro",
"using_best_quote": "Uso de la mejor cotización",
"view_details": "Ver detalles",
"estimated_gas_fee": "Tarifa de gas estimada",
"max_gas_fee": "Tarifa de gas máxima",
Expand All @@ -2165,10 +2164,6 @@
"completed_swap": "Swap",
"metamask_swap_fee": "Tarifa de intercambio de MetaMask",
"fee_text": {
"get_the": "Obtenga",
"best_price": "el mejor precio",
"from_the": "de las",
"top_liquidity": "mejores fuentes de liquidez.",
"fee_is_applied": "Una tarifa de {{fee}} se incluye automáticamente en esta cotización. Lo paga a cambio de una licencia para usar el software de agregación de información del proveedor de liquidez de MetaMask.",
"fee_is_not_applied": "MetaMask no incluye una tarifa adicional en esta cotización."
},
Expand Down
5 changes: 0 additions & 5 deletions locales/languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,6 @@
"i_understand": "Je comprends",
"quotes_expire_in": "Les cotations expirent dans",
"saving": "Enregistrement",
"using_best_quote": "Utiliser la meilleure cotation",
"view_details": "Voir les détails",
"estimated_gas_fee": "Frais de gaz estimés",
"max_gas_fee": "Frais de gaz maximums",
Expand All @@ -2165,10 +2164,6 @@
"completed_swap": "Échanger !",
"metamask_swap_fee": "Commission de swap MetaMask",
"fee_text": {
"get_the": "Bénéficiez en permanence",
"best_price": "du meilleur prix",
"from_the": "auprès des",
"top_liquidity": "meilleures sources de liquidités.",
"fee_is_applied": "Des frais de {{fee}} sont automatiquement ajoutés à ce devis. Ces frais vous sont facturés en échange d'une licence d'utilisation du logiciel d'agrégation d'informations sur les fournisseurs de liquidités de MetaMask.",
"fee_is_not_applied": "MetaMask n’inclut pas de frais supplémentaires dans ce devis."
},
Expand Down
5 changes: 0 additions & 5 deletions locales/languages/hi-in.json
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,6 @@
"i_understand": "मैं समझता हूं",
"quotes_expire_in": "उद्धरण की समय-सीमा समाप्ति है",
"saving": "सहेजा जा रहा है",
"using_best_quote": "सर्वोत्तम उद्धरण का उपयोग करना",
"view_details": "विवरण देखें",
"estimated_gas_fee": "अनुमानित गैस शुल्क",
"max_gas_fee": "अधिकतम गैस शुल्क",
Expand All @@ -1449,10 +1448,6 @@
"completed_swap": "स्वैप!",
"metamask_swap_fee": "MetaMask स्वैप शुल्क",
"fee_text": {
"get_the": "हर बार",
"best_price": "शीर्ष चलनिधि",
"from_the": "स्रोतों से",
"top_liquidity": "सर्वोत्तम मूल्य प्राप्त करें।",
"fee_is_applied": "{{fee}} का शुल्क स्वचालित रूप से प्रत्येक उद्धरण में शामिल होता है, जो MetaMask को और बेहतर बनाने के लिए चालू विकास का समर्थन करता है।"
},
"enable": {
Expand Down
5 changes: 0 additions & 5 deletions locales/languages/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,6 @@
"i_understand": "मैं समझता हूं",
"quotes_expire_in": "उद्धरणों की समय सीमा समाप्त होती है",
"saving": "बचत",
"using_best_quote": "सबसे बढ़िया उद्धरण का उपयोग कर रहे हैं",
"view_details": "विवरण देखें",
"estimated_gas_fee": "अनुमानित गैस शुल्क",
"max_gas_fee": "अधिकतम गैस शुल्क",
Expand All @@ -2165,10 +2164,6 @@
"completed_swap": "स्वैप!",
"metamask_swap_fee": "MetaMask स्वैप शुल्क",
"fee_text": {
"get_the": "पाएं",
"best_price": "सबसे अच्छी कीमत",
"from_the": "से",
"top_liquidity": "हर समय शीर्ष चल-निधि स्रोत।",
"fee_is_applied": "एक शुल्क {{fee}} स्वचालित रूप से इस उद्धरण में समाविष्ट हो जाता है।आप इसे MetaMask's के तरलता प्रदाता सूचना एकत्रीकरण सॉफ़्टवेयर का उपयोग करने के लिए लाइसेंस के बदले में भुगतान करते हैं।",
"fee_is_not_applied": "MetaMask इस ऑफ़र में कोई अतिरिक्त शुल्क शामिल नहीं करता है।"
},
Expand Down
5 changes: 0 additions & 5 deletions locales/languages/id-id.json
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,6 @@
"i_understand": "Saya paham",
"quotes_expire_in": "Kuota kedaluwarsa dalam",
"saving": "Menyimpan",
"using_best_quote": "Menggunakan kuota terbaik",
"view_details": "Lihat detail",
"estimated_gas_fee": "Biaya jaringan yang diperkirakan",
"max_gas_fee": "Biaya jaringan maksimum",
Expand All @@ -1449,10 +1448,6 @@
"completed_swap": "Tukar!",
"metamask_swap_fee": "Biaya Penukaran MetaMask",
"fee_text": {
"get_the": "Dapatkan",
"best_price": "harga terbaik",
"from_the": "dari",
"top_liquidity": "sumber likuiditas teratas setiap saat.",
"fee_is_applied": "Biaya sebesar {{fee}} secara otomatis diperhitungkan ke dalam setiap kuota, yang mendukung pengembangan berkelanjutan untuk membuat MetaMask lebih baik lagi."
},
"enable": {
Expand Down
5 changes: 0 additions & 5 deletions locales/languages/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,6 @@
"i_understand": "Saya mengerti",
"quotes_expire_in": "Kuotasi berakhir dalam",
"saving": "Menyimpan",
"using_best_quote": "Menggunakan kuotasi terbaik",
"view_details": "Lihat detail",
"estimated_gas_fee": "Estimasi biaya gas",
"max_gas_fee": "Biaya gas maks",
Expand All @@ -2165,10 +2164,6 @@
"completed_swap": "Tukar!",
"metamask_swap_fee": "Biaya MetaMask Swap",
"fee_text": {
"get_the": "Dapatkan",
"best_price": "harga terbaik",
"from_the": "dari",
"top_liquidity": "sumber likuiditas teratas setiap saat.",
"fee_is_applied": "Biaya sebesar {{fee}} otomatis diperhitungkan ke dalam kuotasi ini. Anda membayarnya sebagai ganti lisensi untuk menggunakan perangkat lunak pengumpul informasi penyedia likuiditas MetaMask.",
"fee_is_not_applied": "MetaMask tidak menyertakan biaya tambahan dalam kuotasi ini."
},
Expand Down
5 changes: 0 additions & 5 deletions locales/languages/ja-jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,6 @@
"i_understand": "理解しました",
"quotes_expire_in": "見積もりは期限が切れる",
"saving": "セーブする",
"using_best_quote": "最良の見積もりを使用する",
"view_details": "詳細の表示",
"estimated_gas_fee": "推定のガス料金",
"max_gas_fee": "ガス費の最大値",
Expand All @@ -1449,10 +1448,6 @@
"completed_swap": "スワップ!",
"metamask_swap_fee": "MetaMask スワップ手数料",
"fee_text": {
"get_the": "トップレベルの",
"best_price": "流動性をもつ",
"from_the": "ソースから",
"top_liquidity": "ベストプライスを手に入れましょう。",
"fee_is_applied": "見積には {{fee}}% の手数料が自動的に組み込まれ、MetaMask の将来の開発をサポートします。"
},
"enable": {
Expand Down
5 changes: 0 additions & 5 deletions locales/languages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,6 @@
"i_understand": "理解しています",
"quotes_expire_in": "クォートの期限切れまで残り",
"saving": "保存中",
"using_best_quote": "最適なクォートを使用中",
"view_details": "詳細を表示",
"estimated_gas_fee": "ガス代の見積もり",
"max_gas_fee": "最大ガス代",
Expand All @@ -2165,10 +2164,6 @@
"completed_swap": "スワップ!",
"metamask_swap_fee": "MetaMaskのスワップ手数料",
"fee_text": {
"get_the": "トップの",
"best_price": "流動性",
"from_the": "供給源から",
"top_liquidity": "毎回最も有利な価格を利用。",
"fee_is_applied": "このクォートには、{{fee}}の手数料が自動的に含まれています。この手数料は、MetaMaskの流動性プロバイダー情報集約ソフトウェアの使用ライセンスの代金として支払うものです。",
"fee_is_not_applied": "MetaMaskはこのクォートに追加手数料を含めません。"
},
Expand Down
5 changes: 0 additions & 5 deletions locales/languages/ko-kr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,6 @@
"i_understand": "이해했습니다.",
"quotes_expire_in": "견적 만료:",
"saving": "저장 중",
"using_best_quote": "최고 견적을 사용 중",
"view_details": "세부 정보 보기",
"estimated_gas_fee": "예상 Gas 요금",
"max_gas_fee": "최대 가스 요금",
Expand All @@ -1449,10 +1448,6 @@
"completed_swap": "스왑!",
"metamask_swap_fee": "MetaMask 스왑 수수료",
"fee_text": {
"get_the": "언제나",
"best_price": "최고의",
"from_the": "유동성 소스에서",
"top_liquidity": "최고의 가격으로 이용하세요.",
"fee_is_applied": "{{fee}}의 수수료는 각 견적에 자동으로 반영되며 MetaMask를 더욱 개선할 수 있도록 현재 진행 중인 개발에 사용됩니다."
},
"enable": {
Expand Down
5 changes: 0 additions & 5 deletions locales/languages/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,6 @@
"i_understand": "견적은 다음 기간 전에 만료됨을",
"quotes_expire_in": "이해합니다:",
"saving": "저장",
"using_best_quote": "최고 견적 사용",
"view_details": "세부 사항 확인",
"estimated_gas_fee": "예상 가스비",
"max_gas_fee": "최대 가스비",
Expand All @@ -2165,10 +2164,6 @@
"completed_swap": "스와프!",
"metamask_swap_fee": "MetaMask 스와프 수수료",
"fee_text": {
"get_the": "최고의",
"best_price": "가격을",
"from_the": "다음의",
"top_liquidity": "최고 유동성 출처에서 매번 얻으세요.",
"fee_is_applied": "{{fee}}의 수수료는 자동으로 각 견적에 반영됩니다. 이는 MetaMask의 유동성 공급자 정보 집계용 소프트웨어 사용 라이선스 비용입니다.",
"fee_is_not_applied": "MetaMask에서는 이 견적에 추가 비용을 부과되지 않습니다."
},
Expand Down
Loading
Loading