From 40b441fcc1f75419599a77a76046b19fdb423ae9 Mon Sep 17 00:00:00 2001 From: Kieran O'Neill Date: Sun, 22 Sep 2024 11:55:25 +0100 Subject: [PATCH] feat: add option to account overflow to make account primary --- src/extension/pages/AccountPage/AccountPage.tsx | 16 ++++++++++++++++ src/extension/translations/en.ts | 1 + 2 files changed, 17 insertions(+) diff --git a/src/extension/pages/AccountPage/AccountPage.tsx b/src/extension/pages/AccountPage/AccountPage.tsx index 405f1b02..2c8db47c 100644 --- a/src/extension/pages/AccountPage/AccountPage.tsx +++ b/src/extension/pages/AccountPage/AccountPage.tsx @@ -24,6 +24,7 @@ import { IoLockOpenOutline, IoPencil, IoQrCodeOutline, + IoStarOutline, IoTrashOutline, } from 'react-icons/io5'; import { useDispatch } from 'react-redux'; @@ -68,6 +69,7 @@ import { TReKeyType, } from '@extension/features/re-key-account'; import { saveToStorageThunk as saveSettingsToStorageThunk } from '@extension/features/settings'; +import { savePolisAccountIDThunk } from '@extension/features/system'; // hooks import useDefaultTextColor from '@extension/hooks/useDefaultTextColor'; @@ -174,6 +176,8 @@ const AccountPage: FC = () => { }; const handleAddAccountClick = () => navigate(ADD_ACCOUNT_ROUTE); const handleOnEditAccountClick = () => onEditAccountModalOpen(); + const handleOnMakePrimaryClick = () => + account && dispatch(savePolisAccountIDThunk(account.id)); const handleOnWhatsNewClick = () => dispatch(setWhatsNewModal(true)); const handleOnRefreshActivityClick = () => { dispatch( @@ -417,6 +421,18 @@ const AccountPage: FC = () => { ('labels.makePrimary'), + onSelect: handleOnMakePrimaryClick, + }, + ] + : []), // re-key ...(canReKeyAccount() ? [ diff --git a/src/extension/translations/en.ts b/src/extension/translations/en.ts index 8e597d8b..eafd55c8 100644 --- a/src/extension/translations/en.ts +++ b/src/extension/translations/en.ts @@ -557,6 +557,7 @@ const translation: IResourceLanguage = { lastRound: 'Last Round', light: 'Light', debugLogging: 'Debug Logging', + makePrimary: 'Make Primary', manage: 'Manage', managerAccount: 'Manager Account', max: 'Max',