From e8d4f11cbf6c1dc6ccf89f331cfdc0eb5ee4f34d Mon Sep 17 00:00:00 2001 From: Guillaume Roux Date: Fri, 25 Mar 2022 16:09:22 +0100 Subject: [PATCH] Dark Mode: Swap hex colors in ui/components/ui folder (#14191) --- .../actionable-message.stories.js | 4 +- .../ui/breadcrumbs/breadcrumbs.component.js | 5 ++- .../breadcrumbs/breadcrumbs.component.test.js | 6 +-- .../export-text-container.component.js | 2 +- .../ui/form-field/form-field.stories.js | 6 ++- ui/components/ui/icon/README.mdx | 7 ---- ui/components/ui/icon/icon.stories.js | 13 +----- ui/components/ui/icon/paper-airplane-icon.js | 41 ------------------- .../ui/icon/sun-check-icon.component.js | 8 +++- .../ui/info-tooltip/info-tooltip-icon.js | 4 +- ui/components/ui/info-tooltip/info-tooltip.js | 2 +- .../ui/list-item/list-item.stories.js | 11 +++-- .../loading-screen.component.js | 5 ++- .../nickname-popover.component.js | 2 +- ui/components/ui/slider/slider.component.js | 8 ++-- ui/components/ui/spinner/spinner.component.js | 2 +- .../ui/text-field/text-field.component.js | 8 ++-- .../toggle-button/toggle-button.component.js | 16 ++++---- 18 files changed, 56 insertions(+), 94 deletions(-) delete mode 100644 ui/components/ui/icon/paper-airplane-icon.js diff --git a/ui/components/ui/actionable-message/actionable-message.stories.js b/ui/components/ui/actionable-message/actionable-message.stories.js index 6ce95259a..b4087a115 100644 --- a/ui/components/ui/actionable-message/actionable-message.stories.js +++ b/ui/components/ui/actionable-message/actionable-message.stories.js @@ -110,7 +110,7 @@ export const WithIcon = (args) => ; WithIcon.args = { className: 'actionable-message--left-aligned actionable-message--warning', useIcon: true, - iconFillColor: '#f8c000', + iconFillColor: 'var(--color-waring-default)', }; export const PrimaryV2Action = (args) => ; @@ -119,7 +119,7 @@ PrimaryV2Action.args = { message: 'We were not able to estimate gas. There might be an error in the contract and this transaction may fail.', useIcon: true, - iconFillColor: '#d73a49', + iconFillColor: 'var(--color-error-default)', type: 'danger', primaryActionV2: { label: 'I want to proceed anyway', diff --git a/ui/components/ui/breadcrumbs/breadcrumbs.component.js b/ui/components/ui/breadcrumbs/breadcrumbs.component.js index c00844aa1..986d709b0 100644 --- a/ui/components/ui/breadcrumbs/breadcrumbs.component.js +++ b/ui/components/ui/breadcrumbs/breadcrumbs.component.js @@ -21,7 +21,10 @@ export default class Breadcrumbs extends PureComponent { key={i} className="breadcrumb" style={{ - backgroundColor: i === currentIndex ? '#D8D8D8' : '#FFFFFF', + backgroundColor: + i === currentIndex + ? 'var(--color-background-alternative)' + : 'var(--color-background-default)', }} /> ))} diff --git a/ui/components/ui/breadcrumbs/breadcrumbs.component.test.js b/ui/components/ui/breadcrumbs/breadcrumbs.component.test.js index ec18a434a..73b9347ce 100644 --- a/ui/components/ui/breadcrumbs/breadcrumbs.component.test.js +++ b/ui/components/ui/breadcrumbs/breadcrumbs.component.test.js @@ -11,12 +11,12 @@ describe('Breadcrumbs Component', () => { expect(wrapper.find('.breadcrumb')).toHaveLength(3); expect( wrapper.find('.breadcrumb').at(0).props().style.backgroundColor, - ).toStrictEqual('#FFFFFF'); + ).toStrictEqual('var(--color-background-default)'); expect( wrapper.find('.breadcrumb').at(1).props().style.backgroundColor, - ).toStrictEqual('#D8D8D8'); + ).toStrictEqual('var(--color-background-alternative)'); expect( wrapper.find('.breadcrumb').at(2).props().style.backgroundColor, - ).toStrictEqual('#FFFFFF'); + ).toStrictEqual('var(--color-background-default)'); }); }); diff --git a/ui/components/ui/export-text-container/export-text-container.component.js b/ui/components/ui/export-text-container/export-text-container.component.js index 8eb56cf8b..7223305c0 100644 --- a/ui/components/ui/export-text-container/export-text-container.component.js +++ b/ui/components/ui/export-text-container/export-text-container.component.js @@ -21,7 +21,7 @@ function ExportTextContainer({ text = '' }) { handleCopy(text); }} > - +
{copied ? t('copiedExclamation') : t('copyToClipboard')}
diff --git a/ui/components/ui/form-field/form-field.stories.js b/ui/components/ui/form-field/form-field.stories.js index 3d5ee3b7f..0c7d0c36f 100644 --- a/ui/components/ui/form-field/form-field.stories.js +++ b/ui/components/ui/form-field/form-field.stories.js @@ -55,7 +55,11 @@ export const FormFieldWithTitleDetail = (args) => { text:
Detail
, button: ( diff --git a/ui/components/ui/slider/slider.component.js b/ui/components/ui/slider/slider.component.js index 69c05ba26..9061dee58 100644 --- a/ui/components/ui/slider/slider.component.js +++ b/ui/components/ui/slider/slider.component.js @@ -19,12 +19,12 @@ const styles = { }, rail: { borderRadius: 50, - background: '#D6D9DC', + background: 'var(--color-background-alternative)', height: 6, }, track: { borderRadius: 50, - background: '#037DD6', + background: 'var(--color-primary-default)', height: 6, }, thumb: { @@ -32,8 +32,8 @@ const styles = { width: 20, marginTop: -7, marginLeft: -7, - backgroundColor: '#037DD6', - border: '1px solid #EAF6FF', + backgroundColor: 'var(--color-primary-default)', + border: '1px solid var(--color-border-muted)', boxSizing: 'border-box', boxShadow: '0px 0px 14px 0px rgba(0, 0, 0, 0.18)', '&:focus, &$active': { diff --git a/ui/components/ui/spinner/spinner.component.js b/ui/components/ui/spinner/spinner.component.js index 634398823..58af19aff 100644 --- a/ui/components/ui/spinner/spinner.component.js +++ b/ui/components/ui/spinner/spinner.component.js @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -const Spinner = ({ className = '', color = '#000000' }) => { +const Spinner = ({ className = '', color = 'var(--color-text-default)' }) => { return (