From f5fff3cc499399dc8476d0321e1d593623851196 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 8 Nov 2023 11:54:07 +0100 Subject: [PATCH 1/5] Allow to remove account --- .changelog/1752.feature.md | 1 + .../Features/Account/ManageableAccount.tsx | 14 +++++++---- .../Account/ManageableAccountDetails.tsx | 23 +++++++++++++------ .../Features/AccountSelector/index.tsx | 8 +++++-- src/app/state/wallet/index.ts | 8 ++++++- src/locales/en/translation.json | 3 +++ 6 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 .changelog/1752.feature.md diff --git a/.changelog/1752.feature.md b/.changelog/1752.feature.md new file mode 100644 index 0000000000..d3b051164c --- /dev/null +++ b/.changelog/1752.feature.md @@ -0,0 +1 @@ +Add remove account feature diff --git a/src/app/components/Toolbar/Features/Account/ManageableAccount.tsx b/src/app/components/Toolbar/Features/Account/ManageableAccount.tsx index 604a3d18d2..238eaa6276 100644 --- a/src/app/components/Toolbar/Features/Account/ManageableAccount.tsx +++ b/src/app/components/Toolbar/Features/Account/ManageableAccount.tsx @@ -14,22 +14,28 @@ import { ManageableAccountDetails } from './ManageableAccountDetails' export const ManageableAccount = ({ wallet, isActive, - onClick, + deleteWallet, + selectWallet, }: { wallet: Wallet isActive: boolean - onClick: (address: string) => void + deleteWallet: (address: string) => void + selectWallet: (address: string) => void }) => { const { t } = useTranslation() const [layerVisibility, setLayerVisibility] = useState(false) const isMobile = useContext(ResponsiveContext) === 'small' + const handleDelete = (address: string) => { + deleteWallet(address) + setLayerVisibility(false) + } return ( <> - +