From 1607295feb915c5daaac9f8a804a28e71a26ee4d Mon Sep 17 00:00:00 2001 From: George Marshall Date: Tue, 8 Mar 2022 11:06:45 -0800 Subject: [PATCH] Updating AccountList to use darkmode colors (#13864) --- ui/components/ui/account-list/account-list.js | 3 +- .../ui/account-list/account-list.stories.js | 67 +++++++++++++++++++ ui/components/ui/account-list/index.scss | 20 +++--- 3 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 ui/components/ui/account-list/account-list.stories.js diff --git a/ui/components/ui/account-list/account-list.js b/ui/components/ui/account-list/account-list.js index 876393db5..a005857ae 100644 --- a/ui/components/ui/account-list/account-list.js +++ b/ui/components/ui/account-list/account-list.js @@ -21,7 +21,6 @@ const AccountList = ({ }) => { const t = useI18nContext(); const selectedAccountScrollRef = useRef(null); - useLayoutEffect(() => { selectedAccountScrollRef.current?.scrollIntoView({ behavior: 'smooth' }); }, []); @@ -103,7 +102,7 @@ const AccountList = ({ className="choose-account-list__account__balance" type={PRIMARY} value={balance} - style={{ color: '#6A737D' }} + style={{ color: 'var(--color-text-alternative)' }} suffix={nativeCurrency} /> diff --git a/ui/components/ui/account-list/account-list.stories.js b/ui/components/ui/account-list/account-list.stories.js new file mode 100644 index 000000000..a6059e565 --- /dev/null +++ b/ui/components/ui/account-list/account-list.stories.js @@ -0,0 +1,67 @@ +import React from 'react'; +import AccountList from '.'; + +export default { + title: 'Components/UI/AccountList', // title should follow the folder structure location of the component. Don't use spaces. + id: __filename, + argTypes: { + accounts: { + control: 'object', + }, + selectNewAccountViaModal: { + action: 'selectNewAccountViaModal', + }, + addressLastConnectedMap: { + control: 'object', + }, + nativeCurrency: { + control: 'text', + }, + selectedAccounts: { + control: 'object', + }, + allAreSelected: { + action: 'allAreSelected', + }, + deselectAll: { + action: 'deselectAll', + }, + selectAll: { + action: 'selectAll', + }, + handleAccountClick: { + action: 'handleAccountClick', + }, + }, + args: { + accounts: [ + { + address: '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4', + addressLabel: 'Account 1', + lastConnectedDate: 'Feb-22-2022', + balance: '8.7a73149c048545a3fe58', + has: () => { + /** nothing to do */ + }, + }, + ], + selectedAccounts: { + address: '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4', + addressLabel: 'Account 2', + lastConnectedDate: 'Feb-22-2022', + balance: '8.7a73149c048545a3fe58', + has: () => { + /** nothing to do */ + }, + }, + addressLastConnectedMap: { + '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4': 'Feb-22-2022', + }, + allAreSelected: () => true, + nativeCurrency: 'USD', + }, +}; + +export const DefaultStory = (args) => ; + +DefaultStory.storyName = 'Default'; diff --git a/ui/components/ui/account-list/index.scss b/ui/components/ui/account-list/index.scss index 712425f8e..6b61dcfb5 100644 --- a/ui/components/ui/account-list/index.scss +++ b/ui/components/ui/account-list/index.scss @@ -42,7 +42,7 @@ flex: 2 1 0; width: 100%; max-height: max-content; - border: 1px solid #d0d5da; + border: 1px solid var(--color-border-muted); box-sizing: border-box; border-radius: 8px; margin-top: 8px; @@ -53,7 +53,7 @@ display: flex; align-items: center; padding: 16px; - border-bottom: 1px solid #d2d8dd; + border-bottom: 1px solid var(--color-border-muted); justify-content: space-between; &:last-of-type { @@ -61,7 +61,7 @@ } &:hover { - background: var(--Grey-000); + background: var(--color-background-alternative); cursor: pointer; } @@ -75,7 +75,7 @@ &__label { @include H6; - color: var(--Black-100); + color: var(--color-text-default); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; @@ -84,7 +84,7 @@ &__balance { @include H7; - color: var(--Grey-500); + color: var(--color-text-default); } &__last-connected { @@ -93,7 +93,7 @@ display: flex; flex-direction: column; align-items: flex-end; - color: var(--primary-blue); + color: var(--color-primary-default); } } @@ -113,14 +113,14 @@ } .fa-info-circle { - color: var(--Grey-200); + color: var(--color-icon-muted); cursor: pointer; margin-inline-start: 8px; font-size: 0.9rem; } .fa-info-circle:hover { - color: var(--Grey-300); + color: var(--color-icon-default); } &__text, @@ -130,11 +130,11 @@ } &__text-blue { - color: var(--primary-blue); + color: var(--color-primary-default); cursor: pointer; } &__text-grey { - color: var(--Grey-500); + color: var(--color-text-default); } }