From 9e01b5a3a8ac294914606db03249cd06056435a1 Mon Sep 17 00:00:00 2001 From: Arjun Porwal <65214523+ap211unitech@users.noreply.github.com> Date: Mon, 5 May 2025 23:32:01 +0530 Subject: [PATCH] Import and export of addresses to the My Accounts Tab (#11507) * feat: Add ExportAll modal for batch exporting accounts * feat: Add ImportAll modal for batch importing accounts * feat: Update ExportAll modal to support checkbox selection for account types and improve validation in ImportAll modal --- packages/page-accounts/src/Accounts/index.tsx | 27 ++++ .../page-accounts/src/modals/ExportAll.tsx | 138 +++++++++++++++++ .../page-accounts/src/modals/ImportAll.tsx | 142 ++++++++++++++++++ 3 files changed, 307 insertions(+) create mode 100644 packages/page-accounts/src/modals/ExportAll.tsx create mode 100644 packages/page-accounts/src/modals/ImportAll.tsx diff --git a/packages/page-accounts/src/Accounts/index.tsx b/packages/page-accounts/src/Accounts/index.tsx index 530e5a96ec..8e8c35a498 100644 --- a/packages/page-accounts/src/Accounts/index.tsx +++ b/packages/page-accounts/src/Accounts/index.tsx @@ -17,7 +17,9 @@ import { settings } from '@polkadot/ui-settings'; import { BN_ZERO, isFunction } from '@polkadot/util'; import CreateModal from '../modals/Create.js'; +import ExportAll from '../modals/ExportAll.js'; import ImportModal from '../modals/Import.js'; +import ImportAll from '../modals/ImportAll.js'; import Ledger from '../modals/Ledger.js'; import Local from '../modals/LocalAdd.js'; import Multisig from '../modals/MultisigCreate.js'; @@ -104,6 +106,8 @@ function Overview ({ className = '', onStatusChange }: Props): React.ReactElemen const [isProxyOpen, toggleProxy] = useToggle(); const [isLocalOpen, toggleLocal] = useToggle(); const [isQrOpen, toggleQr] = useToggle(); + const [isExportAll, toggleExportAll] = useToggle(); + const [isImportAll, toggleImportAll] = useToggle(); const [favorites, toggleFavorite] = useFavorites(STORE_FAVS); const [balances, setBalances] = useState({ accounts: {} }); const [filterOn, setFilter] = useState(''); @@ -318,6 +322,19 @@ function Overview ({ className = '', onStatusChange }: Props): React.ReactElemen onStatusChange={onStatusChange} /> )} + {isExportAll && ( + + )} + {isImportAll && ( + + )} @@ -360,6 +377,16 @@ function Overview ({ className = '', onStatusChange }: Props): React.ReactElemen /> )} +