From fc6c22abe3b2c24fcf2527b73ae21a9257639791 Mon Sep 17 00:00:00 2001 From: 0xKheops <26880866+0xKheops@users.noreply.github.com> Date: Mon, 16 Dec 2024 12:41:09 +0900 Subject: [PATCH 1/2] feat: rename receive to copy, and enable it, for watched accounts --- .../Portfolio/DashboardPortfolioHeader.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/extension/src/ui/domains/Portfolio/DashboardPortfolioHeader.tsx b/apps/extension/src/ui/domains/Portfolio/DashboardPortfolioHeader.tsx index 9ca63fedc9..268a550417 100644 --- a/apps/extension/src/ui/domains/Portfolio/DashboardPortfolioHeader.tsx +++ b/apps/extension/src/ui/domains/Portfolio/DashboardPortfolioHeader.tsx @@ -271,14 +271,13 @@ const TopActions: FC = () => { { analyticsName: "Goto", analyticsAction: "open receive", - label: t("Receive"), + label: !!selectedAccount && !isOwnedAccount(selectedAccount) ? t("Copy") : t("Receive"), icon: ArrowDownIcon, onClick: () => openCopyAddressModal({ address: selectedAddress, }), - disabled: disableActions, - disabledReason, + disabled: !selectedAccounts.length, // always allow, as long as there is at least one account }, { analyticsName: "Goto", @@ -299,7 +298,17 @@ const TopActions: FC = () => { } : null, ].filter(Boolean) as Array, - [canBuy, disableActions, disabledReason, selectedAddress, openCopyAddressModal, symbol, t], + [ + t, + disableActions, + disabledReason, + selectedAccount, + selectedAccounts.length, + canBuy, + selectedAddress, + symbol, + openCopyAddressModal, + ], ) return ( From 3cb406e96f55a28667fb1382cdfe606dd9a2d01b Mon Sep 17 00:00:00 2001 From: 0xKheops <26880866+0xKheops@users.noreply.github.com> Date: Mon, 16 Dec 2024 12:42:26 +0900 Subject: [PATCH 2/2] feat: disable swap button for watched accounts --- .../extension/src/ui/apps/popup/components/TotalFiatBalance.tsx | 2 ++ .../src/ui/domains/Portfolio/DashboardPortfolioHeader.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/apps/extension/src/ui/apps/popup/components/TotalFiatBalance.tsx b/apps/extension/src/ui/apps/popup/components/TotalFiatBalance.tsx index 3dae654a44..6142b3c58a 100644 --- a/apps/extension/src/ui/apps/popup/components/TotalFiatBalance.tsx +++ b/apps/extension/src/ui/apps/popup/components/TotalFiatBalance.tsx @@ -204,6 +204,8 @@ const TopActions = ({ disabled }: { disabled?: boolean }) => { label: t("Swap"), icon: RepeatIcon, onClick: () => handleSwapClick(), + disabled: disableActions, + disabledReason, }, canBuy ? { diff --git a/apps/extension/src/ui/domains/Portfolio/DashboardPortfolioHeader.tsx b/apps/extension/src/ui/domains/Portfolio/DashboardPortfolioHeader.tsx index 268a550417..75aadf57fe 100644 --- a/apps/extension/src/ui/domains/Portfolio/DashboardPortfolioHeader.tsx +++ b/apps/extension/src/ui/domains/Portfolio/DashboardPortfolioHeader.tsx @@ -285,6 +285,8 @@ const TopActions: FC = () => { label: t("Swap"), icon: RepeatIcon, onClick: () => window.open(TALISMAN_WEB_APP_SWAP_URL, "_blank"), + disabled: disableActions, + disabledReason, }, canBuy ? {