From cb5568ece20faf89cd91d9792f6e173964864181 Mon Sep 17 00:00:00 2001 From: Edgar Goetzendorff Date: Sat, 10 Oct 2020 03:01:20 +0200 Subject: [PATCH] refactor: hide percentage bar if portfolio has no balance (#2962) --- package.json | 38 +- .../components/WalletCard/WalletCard.test.tsx | 2 +- .../WalletListItem/WalletListItem.test.tsx | 2 +- src/domains/dashboard/i18n.ts | 2 +- .../dashboard/pages/Dashboard/Dashboard.tsx | 16 +- .../__snapshots__/Dashboard.test.tsx.snap | 48 +- .../__snapshots__/CreateProfile.test.tsx.snap | 2 +- .../__snapshots__/Settings.test.tsx.snap | 2 +- .../AddressRow/AddressRow.test.tsx | 2 +- src/utils/storybook.tsx | 2 +- yarn.lock | 1413 +++++++++++------ 11 files changed, 970 insertions(+), 559 deletions(-) diff --git a/package.json b/package.json index 014d8bf990..651f216ce8 100644 --- a/package.json +++ b/package.json @@ -120,25 +120,25 @@ "testRunner": "jest-circus/runner" }, "dependencies": { - "@arkecosystem/platform-sdk": "^0.9.391", - "@arkecosystem/platform-sdk-ada": "^0.9.391", - "@arkecosystem/platform-sdk-ark": "^0.9.391", - "@arkecosystem/platform-sdk-atom": "^0.9.391", - "@arkecosystem/platform-sdk-btc": "^0.9.391", - "@arkecosystem/platform-sdk-crypto": "^0.9.391", - "@arkecosystem/platform-sdk-eos": "^0.9.391", - "@arkecosystem/platform-sdk-eth": "^0.9.391", - "@arkecosystem/platform-sdk-intl": "^0.9.391", - "@arkecosystem/platform-sdk-ipfs": "^0.9.391", - "@arkecosystem/platform-sdk-lsk": "^0.9.391", - "@arkecosystem/platform-sdk-markets": "^0.9.391", - "@arkecosystem/platform-sdk-neo": "^0.9.391", - "@arkecosystem/platform-sdk-news": "^0.9.391", - "@arkecosystem/platform-sdk-profiles": "^0.9.391", - "@arkecosystem/platform-sdk-support": "^0.9.391", - "@arkecosystem/platform-sdk-trx": "^0.9.391", - "@arkecosystem/platform-sdk-xmr": "^0.9.391", - "@arkecosystem/platform-sdk-xrp": "^0.9.391", + "@arkecosystem/platform-sdk": "^0.9.394", + "@arkecosystem/platform-sdk-ada": "^0.9.394", + "@arkecosystem/platform-sdk-ark": "^0.9.394", + "@arkecosystem/platform-sdk-atom": "^0.9.394", + "@arkecosystem/platform-sdk-btc": "^0.9.394", + "@arkecosystem/platform-sdk-crypto": "^0.9.394", + "@arkecosystem/platform-sdk-eos": "^0.9.394", + "@arkecosystem/platform-sdk-eth": "^0.9.394", + "@arkecosystem/platform-sdk-intl": "^0.9.394", + "@arkecosystem/platform-sdk-ipfs": "^0.9.394", + "@arkecosystem/platform-sdk-lsk": "^0.9.394", + "@arkecosystem/platform-sdk-markets": "^0.9.394", + "@arkecosystem/platform-sdk-neo": "^0.9.394", + "@arkecosystem/platform-sdk-news": "^0.9.394", + "@arkecosystem/platform-sdk-profiles": "^0.9.394", + "@arkecosystem/platform-sdk-support": "^0.9.394", + "@arkecosystem/platform-sdk-trx": "^0.9.394", + "@arkecosystem/platform-sdk-xmr": "^0.9.394", + "@arkecosystem/platform-sdk-xrp": "^0.9.394", "@arkecosystem/utils": "^1.2.0", "@ledgerhq/devices": "^5.15.0", "@ledgerhq/hw-transport-node-hid-singleton": "^5.16.0", diff --git a/src/app/components/WalletCard/WalletCard.test.tsx b/src/app/components/WalletCard/WalletCard.test.tsx index c191cd4f6f..6f28ca74b7 100644 --- a/src/app/components/WalletCard/WalletCard.test.tsx +++ b/src/app/components/WalletCard/WalletCard.test.tsx @@ -21,7 +21,7 @@ describe("Wallet Card", () => { profile = env.profiles().findById(getDefaultProfileId()); wallet = profile.wallets().findById("ac38fe6d-4b67-4ef1-85be-17c5f6841129"); wallet.data().set(WalletFlag.Starred, true); - wallet.data().set(WalletFlag.Ledger, true); + wallet.data().set(WalletFlag.LedgerIndex, true); }); it("should render", () => { diff --git a/src/app/components/WalletListItem/WalletListItem.test.tsx b/src/app/components/WalletListItem/WalletListItem.test.tsx index 2488712d65..820a14049e 100644 --- a/src/app/components/WalletListItem/WalletListItem.test.tsx +++ b/src/app/components/WalletListItem/WalletListItem.test.tsx @@ -21,7 +21,7 @@ describe("WalletListItem", () => { profile = env.profiles().findById(getDefaultProfileId()); wallet = profile.wallets().findById("ac38fe6d-4b67-4ef1-85be-17c5f6841129"); wallet.data().set(WalletFlag.Starred, true); - wallet.data().set(WalletFlag.Ledger, true); + wallet.data().set(WalletFlag.LedgerIndex, true); }); it("should render", () => { diff --git a/src/domains/dashboard/i18n.ts b/src/domains/dashboard/i18n.ts index 65cdf8b520..6074b07e3f 100644 --- a/src/domains/dashboard/i18n.ts +++ b/src/domains/dashboard/i18n.ts @@ -32,7 +32,7 @@ export const translations: { [key: string]: any } = { DASHBOARD_PAGE: { CHART: { TITLE: "Portfolio Chart", - PERCENTAGES_LABEL: "Total portfolio", + PERCENTAGES_LABEL: "Total Portfolio", }, }, }; diff --git a/src/domains/dashboard/pages/Dashboard/Dashboard.tsx b/src/domains/dashboard/pages/Dashboard/Dashboard.tsx index aea49c6987..9613d34f77 100755 --- a/src/domains/dashboard/pages/Dashboard/Dashboard.tsx +++ b/src/domains/dashboard/pages/Dashboard/Dashboard.tsx @@ -117,11 +117,17 @@ export const Dashboard = ({ networks, balances }: DashboardProps) => {
{t("DASHBOARD.DASHBOARD_PAGE.CHART.TITLE")}
-
- + + {!activeProfile.balance().isZero() && ( + <> +
+ + + + )}
)} diff --git a/src/domains/dashboard/pages/Dashboard/__snapshots__/Dashboard.test.tsx.snap b/src/domains/dashboard/pages/Dashboard/__snapshots__/Dashboard.test.tsx.snap index c8d32ad81d..ea077194c5 100644 --- a/src/domains/dashboard/pages/Dashboard/__snapshots__/Dashboard.test.tsx.snap +++ b/src/domains/dashboard/pages/Dashboard/__snapshots__/Dashboard.test.tsx.snap @@ -352,7 +352,7 @@ exports[`Dashboard should fetch more transactions 1`] = `
- Total portfolio + Total Portfolio
- Total portfolio + Total Portfolio
- Total portfolio + Total Portfolio
- Total portfolio + Total Portfolio
- Total portfolio + Total Portfolio
- Total portfolio + Total Portfolio
- Total portfolio + Total Portfolio
-
-
-
-
- Total portfolio -
-
-
-
-