From 11719ef6b0d8630deb1deb6c5fc1feb494bd3bf8 Mon Sep 17 00:00:00 2001
From: dan437 <80175477+dan437@users.noreply.github.com>
Date: Fri, 14 Jul 2023 17:37:18 +0200
Subject: [PATCH] Use the "color" prop instead of scss, update snapshots
---
.../__snapshots__/exchange-rate-display.test.js.snap | 2 +-
.../swaps/exchange-rate-display/exchange-rate-display.js | 5 +++++
ui/pages/swaps/exchange-rate-display/index.scss | 2 --
.../__snapshots__/main-quote-summary.test.js.snap | 2 +-
.../swaps/view-quote/__snapshots__/view-quote.test.js.snap | 4 ++--
5 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/ui/pages/swaps/exchange-rate-display/__snapshots__/exchange-rate-display.test.js.snap b/ui/pages/swaps/exchange-rate-display/__snapshots__/exchange-rate-display.test.js.snap
index 333d518f4e77..bdd3b3dfab0d 100644
--- a/ui/pages/swaps/exchange-rate-display/__snapshots__/exchange-rate-display.test.js.snap
+++ b/ui/pages/swaps/exchange-rate-display/__snapshots__/exchange-rate-display.test.js.snap
@@ -6,7 +6,7 @@ exports[`ExchangeRateDisplay renders the component with initial props 1`] = `
class="exchange-rate-display"
>
diff --git a/ui/pages/swaps/exchange-rate-display/exchange-rate-display.js b/ui/pages/swaps/exchange-rate-display/exchange-rate-display.js
index b95c7b285c1d..12a38e12c8eb 100644
--- a/ui/pages/swaps/exchange-rate-display/exchange-rate-display.js
+++ b/ui/pages/swaps/exchange-rate-display/exchange-rate-display.js
@@ -10,6 +10,7 @@ import {
DISPLAY,
AlignItems,
IconColor,
+ TextColor,
} from '../../../helpers/constants/design-system';
import { Icon, IconName } from '../../../components/component-library';
import { I18nContext } from '../../../contexts/i18n';
@@ -74,6 +75,9 @@ export default function ExchangeRateDisplay({
const quoteRateClassName = onQuotesClick
? 'exchange-rate-display__quote-rate'
: 'exchange-rate-display__quote-rate--no-link';
+ const quoteRateColor = onQuotesClick
+ ? TextColor.primaryDefault
+ : TextColor.textDefault;
return (
@@ -82,6 +86,7 @@ export default function ExchangeRateDisplay({
justifyContent={JustifyContent.center}
alignItems={AlignItems.center}
onClick={onQuotesClick}
+ color={quoteRateColor}
className={quoteRateClassName}
data-testid="exchange-rate-display-quote-rate"
>
diff --git a/ui/pages/swaps/exchange-rate-display/index.scss b/ui/pages/swaps/exchange-rate-display/index.scss
index 397efe3f332f..f59713639344 100644
--- a/ui/pages/swaps/exchange-rate-display/index.scss
+++ b/ui/pages/swaps/exchange-rate-display/index.scss
@@ -18,11 +18,9 @@
&__quote-rate {
cursor: pointer;
- color: var(--color-primary-default);
}
&__quote-rate--no-link {
cursor: text;
- color: var(--color-text-default);
}
}
diff --git a/ui/pages/swaps/main-quote-summary/__snapshots__/main-quote-summary.test.js.snap b/ui/pages/swaps/main-quote-summary/__snapshots__/main-quote-summary.test.js.snap
index f93a0171bea8..b36e37007e03 100644
--- a/ui/pages/swaps/main-quote-summary/__snapshots__/main-quote-summary.test.js.snap
+++ b/ui/pages/swaps/main-quote-summary/__snapshots__/main-quote-summary.test.js.snap
@@ -81,7 +81,7 @@ exports[`MainQuoteSummary renders the component with initial props 4`] = `
class="exchange-rate-display main-quote-summary__exchange-rate-display"
>
diff --git a/ui/pages/swaps/view-quote/__snapshots__/view-quote.test.js.snap b/ui/pages/swaps/view-quote/__snapshots__/view-quote.test.js.snap
index b302ee5f98cb..d9ed7df327f1 100644
--- a/ui/pages/swaps/view-quote/__snapshots__/view-quote.test.js.snap
+++ b/ui/pages/swaps/view-quote/__snapshots__/view-quote.test.js.snap
@@ -38,7 +38,7 @@ exports[`ViewQuote renders the component with EIP-1559 enabled 2`] = `
class="exchange-rate-display main-quote-summary__exchange-rate-display"
>
@@ -110,7 +110,7 @@ exports[`ViewQuote renders the component with initial props 2`] = `
class="exchange-rate-display main-quote-summary__exchange-rate-display"
>