From 757613c3cee4989a819aeddb94d234be7056ff63 Mon Sep 17 00:00:00 2001 From: Amir Ekbatanifard Date: Fri, 7 Jun 2024 15:56:20 +0330 Subject: [PATCH] Address1361 --- packages/extension-base/src/defaults.ts | 2 +- .../fullscreen/homeFullScreen/partials/HomeMenu.tsx | 2 +- .../partials/ImportAccSubMenuFullScreen.tsx | 8 ++++---- .../src/fullscreen/onboarding/index.tsx | 10 +++++----- .../src/partials/AddNewAccountButton.tsx | 4 ++-- .../src/partials/ImportAccSubMenu.tsx | 8 ++++---- packages/extension-polkagate/src/partials/Menu.tsx | 2 +- .../src/partials/NewAccountSubMenu.tsx | 2 +- .../src/popup/passwordManagement/Reset.tsx | 4 ++-- .../src/popup/passwordManagement/ResetFS.tsx | 4 ++-- .../extension-polkagate/src/popup/welcome/index.tsx | 10 +++++----- packages/extension-polkagate/src/util/constants.tsx | 2 +- packages/extension-ui/src/Popup/index.tsx | 12 ++++++------ 13 files changed, 35 insertions(+), 35 deletions(-) diff --git a/packages/extension-base/src/defaults.ts b/packages/extension-base/src/defaults.ts index ee4fa365e..972230e66 100644 --- a/packages/extension-base/src/defaults.ts +++ b/packages/extension-base/src/defaults.ts @@ -1,7 +1,7 @@ // Copyright 2019-2024 @polkadot/extension-base authors & contributors // SPDX-License-Identifier: Apache-2.0 -const ALLOWED_PATH = ['/', '/account/import-ledger', '/account/restore-json'] as const; +const ALLOWED_PATH = ['/', '/create-account-full-screen'] as const; // Added for Polkagate const START_WITH_PATH = [ '/account/', diff --git a/packages/extension-polkagate/src/fullscreen/homeFullScreen/partials/HomeMenu.tsx b/packages/extension-polkagate/src/fullscreen/homeFullScreen/partials/HomeMenu.tsx index b749c4499..6d051f213 100644 --- a/packages/extension-polkagate/src/fullscreen/homeFullScreen/partials/HomeMenu.tsx +++ b/packages/extension-polkagate/src/fullscreen/homeFullScreen/partials/HomeMenu.tsx @@ -73,7 +73,7 @@ export default function HomeMenu (): React.ReactElement { const areAllExternalAccounts = useMemo(() => accounts.every(({ isExternal }) => isExternal), [accounts]); const onCreate = useCallback(() => { - openOrFocusTab('/account/create'); + openOrFocusTab('/create-account-full-screen'); }, []); const onExportAll = useCallback(() => { diff --git a/packages/extension-polkagate/src/fullscreen/homeFullScreen/partials/ImportAccSubMenuFullScreen.tsx b/packages/extension-polkagate/src/fullscreen/homeFullScreen/partials/ImportAccSubMenuFullScreen.tsx index ee3d3ca1a..eb51224f8 100644 --- a/packages/extension-polkagate/src/fullscreen/homeFullScreen/partials/ImportAccSubMenuFullScreen.tsx +++ b/packages/extension-polkagate/src/fullscreen/homeFullScreen/partials/ImportAccSubMenuFullScreen.tsx @@ -27,15 +27,15 @@ function ImportAccSubMenuFullScreen ({ show, toggleSettingSubMenu }: Props): Rea const theme = useTheme(); const onRestoreFromJson = useCallback((): void => { - openOrFocusTab('/account/restore-json'); + openOrFocusTab('/import/restore-json-full-screen'); }, []); const onImportFromSeed = useCallback(() => { - openOrFocusTab('/account/import-seed'); + openOrFocusTab('/import/seed-full-screen'); }, []); const onImportFromRawSeed = useCallback(() => { - openOrFocusTab('/account/import-raw-seed'); + openOrFocusTab('/import/raw-seed-full-screen'); }, []); const onAddWatchOnlyFullScreen = useCallback(() => { @@ -51,7 +51,7 @@ function ImportAccSubMenuFullScreen ({ show, toggleSettingSubMenu }: Props): Rea }, []); const onImportLedger = useCallback((): void => { - openOrFocusTab('/account/import-ledger'); + openOrFocusTab('/import/ledger-full-screen'); }, []); return ( diff --git a/packages/extension-polkagate/src/fullscreen/onboarding/index.tsx b/packages/extension-polkagate/src/fullscreen/onboarding/index.tsx index 50a8396bd..1399f62e6 100644 --- a/packages/extension-polkagate/src/fullscreen/onboarding/index.tsx +++ b/packages/extension-polkagate/src/fullscreen/onboarding/index.tsx @@ -40,13 +40,13 @@ function Onboarding (): React.ReactElement { const onRestoreFromJson = useCallback( (): void => { - windowOpen('/account/restore-json').catch(console.error); + windowOpen('/import/restore-json-full-screen').catch(console.error); }, [] ); const onImportLedger = useCallback( (): void => { - windowOpen('/account/import-ledger').catch(console.error); + windowOpen('/import/ledger-full-screen').catch(console.error); }, [] ); @@ -63,7 +63,7 @@ function Onboarding (): React.ReactElement { const onCreate = useCallback( (): void => { - windowOpen('/account/create').catch(console.error); + windowOpen('/create-account-full-screen').catch(console.error); }, [] ); @@ -75,13 +75,13 @@ function Onboarding (): React.ReactElement { const onImport = useCallback( (): void => { - windowOpen('/account/import-seed').catch(console.error); + windowOpen('/import/seed-full-screen').catch(console.error); }, [] ); const onImportRawSeed = useCallback( (): void => { - windowOpen('/account/import-raw-seed').catch(console.error); + windowOpen('/import/raw-seed-full-screen').catch(console.error); }, [] ); diff --git a/packages/extension-polkagate/src/partials/AddNewAccountButton.tsx b/packages/extension-polkagate/src/partials/AddNewAccountButton.tsx index 32f524f4d..b11a1a6ce 100644 --- a/packages/extension-polkagate/src/partials/AddNewAccountButton.tsx +++ b/packages/extension-polkagate/src/partials/AddNewAccountButton.tsx @@ -22,8 +22,8 @@ export default function AddNewAccountButton (): React.ReactElement { const onCreate = useCallback((): void => { isExtensionMode - ? windowOpen('/account/create').catch(console.error) - : onAction('/account/create'); + ? windowOpen('/create-account-full-screen').catch(console.error) + : onAction('/create-account-full-screen'); }, [isExtensionMode, onAction]); return ( diff --git a/packages/extension-polkagate/src/partials/ImportAccSubMenu.tsx b/packages/extension-polkagate/src/partials/ImportAccSubMenu.tsx index 71a6d77a7..04bd4b6a8 100644 --- a/packages/extension-polkagate/src/partials/ImportAccSubMenu.tsx +++ b/packages/extension-polkagate/src/partials/ImportAccSubMenu.tsx @@ -26,15 +26,15 @@ function ImportAccSubMenu ({ show, toggleSettingSubMenu }: Props): React.ReactEl const onAction = useContext(ActionContext); const onRestoreFromJson = useCallback((): void => { - windowOpen('/account/restore-json').catch(console.error); + windowOpen('/import/restore-json-full-screen').catch(console.error); }, []); const onImportAcc = useCallback(() => { - windowOpen('/account/import-seed').catch(console.error); + windowOpen('/import/seed-full-screen').catch(console.error); }, []); const onImportRawSeed = useCallback(() => { - windowOpen('/account/import-raw-seed').catch(console.error); + windowOpen('/import/raw-seed-full-screen').catch(console.error); }, []); const onAddWatchOnly = useCallback(() => { @@ -46,7 +46,7 @@ function ImportAccSubMenu ({ show, toggleSettingSubMenu }: Props): React.ReactEl }, [onAction]); const onImportLedger = useCallback((): void => { - windowOpen('/account/import-ledger').catch(console.error); + windowOpen('/import/ledger-full-screen').catch(console.error); }, []); const onImportProxied = useCallback((): void => { diff --git a/packages/extension-polkagate/src/partials/Menu.tsx b/packages/extension-polkagate/src/partials/Menu.tsx index 8e7ee5026..e3680aaee 100644 --- a/packages/extension-polkagate/src/partials/Menu.tsx +++ b/packages/extension-polkagate/src/partials/Menu.tsx @@ -65,7 +65,7 @@ function Menu ({ setShowMenu, theme }: Props): React.ReactElement { }, [setShowMenu]); const _goToExportAll = useCallback(() => { - onAction('/account/export-all'); + onAction('/export/all'); }, [onAction]); const onEnableTestnetConfirm = useCallback(() => { diff --git a/packages/extension-polkagate/src/partials/NewAccountSubMenu.tsx b/packages/extension-polkagate/src/partials/NewAccountSubMenu.tsx index 1396bfad9..dbd4feb2d 100644 --- a/packages/extension-polkagate/src/partials/NewAccountSubMenu.tsx +++ b/packages/extension-polkagate/src/partials/NewAccountSubMenu.tsx @@ -27,7 +27,7 @@ function NewAccountSubMenu({ show }: Props): React.ReactElement { }, [master, onAction]); const goToCreateAcc = useCallback(() => { - windowOpen('/account/create').catch(console.error); + windowOpen('/create-account-full-screen').catch(console.error); }, []); return ( diff --git a/packages/extension-polkagate/src/popup/passwordManagement/Reset.tsx b/packages/extension-polkagate/src/popup/passwordManagement/Reset.tsx index b1f0ad81d..d2bab2e92 100644 --- a/packages/extension-polkagate/src/popup/passwordManagement/Reset.tsx +++ b/packages/extension-polkagate/src/popup/passwordManagement/Reset.tsx @@ -19,11 +19,11 @@ function Reset (): React.ReactElement { const theme = useTheme(); const _goToRestoreFromJson = useCallback((): void => { - windowOpen('/account/restore-json').catch(console.error); + windowOpen('/import/restore-json-full-screen').catch(console.error); }, []); const _goToImport = useCallback((): void => { - windowOpen('/account/import-seed').catch(console.error); + windowOpen('/import/seed-full-screen').catch(console.error); }, []); return ( diff --git a/packages/extension-polkagate/src/popup/passwordManagement/ResetFS.tsx b/packages/extension-polkagate/src/popup/passwordManagement/ResetFS.tsx index 2c8f189a9..0553e3408 100644 --- a/packages/extension-polkagate/src/popup/passwordManagement/ResetFS.tsx +++ b/packages/extension-polkagate/src/popup/passwordManagement/ResetFS.tsx @@ -24,11 +24,11 @@ function ResetFS (): React.ReactElement { useFullscreen(); const _goToRestoreFromJson = useCallback((): void => { - windowOpen('/account/restore-json').catch(console.error); + windowOpen('/import/restore-json-full-screen').catch(console.error); }, []); const _goToImport = useCallback((): void => { - windowOpen('/account/import-seed').catch(console.error); + windowOpen('/import/seed-full-screen').catch(console.error); }, []); return ( diff --git a/packages/extension-polkagate/src/popup/welcome/index.tsx b/packages/extension-polkagate/src/popup/welcome/index.tsx index 366f0b095..997c4e792 100644 --- a/packages/extension-polkagate/src/popup/welcome/index.tsx +++ b/packages/extension-polkagate/src/popup/welcome/index.tsx @@ -23,19 +23,19 @@ function Welcome(): React.ReactElement { const onRestoreFromJson = useCallback( (): void => { - windowOpen('/account/restore-json').catch(console.error); + windowOpen('/import/restore-json-full-screen').catch(console.error); }, [] ); const onImportLedger = useCallback( (): void => { - windowOpen('/account/import-ledger').catch(console.error); + windowOpen('/import/ledger-full-screen').catch(console.error); }, [] ); const onCreate = useCallback( (): void => { - windowOpen('/account/create').catch(console.error); + windowOpen('/create-account-full-screen').catch(console.error); }, [] ); @@ -47,13 +47,13 @@ function Welcome(): React.ReactElement { const onImport = useCallback( (): void => { - windowOpen('/account/import-seed').catch(console.error); + windowOpen('/import/seed-full-screen').catch(console.error); }, [] ); const onImportRawSeed = useCallback( (): void => { - windowOpen('/account/import-raw-seed').catch(console.error); + windowOpen('/import/raw-seed-full-screen').catch(console.error); }, [] ); diff --git a/packages/extension-polkagate/src/util/constants.tsx b/packages/extension-polkagate/src/util/constants.tsx index 0965daa15..856a6746e 100644 --- a/packages/extension-polkagate/src/util/constants.tsx +++ b/packages/extension-polkagate/src/util/constants.tsx @@ -209,4 +209,4 @@ export const USD_CURRENCY = { }; export const FULLSCREEN_WIDTH = '900px'; -export const ALLOWED_URL_ON_RESET_PASSWORD = ['/account/restore-json', '/account/import-seed', '/account/import-raw-seed', '/forgot-password', '/reset-wallet']; +export const ALLOWED_URL_ON_RESET_PASSWORD = ['/import/restore-json-full-screen', '/import/seed-full-screen', '/import/raw-seed-full-screen', '/forgot-password', '/reset-wallet']; diff --git a/packages/extension-ui/src/Popup/index.tsx b/packages/extension-ui/src/Popup/index.tsx index b9eba9ef6..db8ee0ea1 100644 --- a/packages/extension-ui/src/Popup/index.tsx +++ b/packages/extension-ui/src/Popup/index.tsx @@ -282,17 +282,13 @@ export default function Popup (): React.ReactElement { {wrapWithErrorBoundary(, 'account')} - {wrapWithErrorBoundary(, 'account-creation')} - {wrapWithErrorBoundary(, 'export-all-address')} - {wrapWithErrorBoundary(, 'import-ledger')} - {wrapWithErrorBoundary(, 'import-seed')} - {wrapWithErrorBoundary(, 'import-raw-seed')} - {wrapWithErrorBoundary(, 'restore-json')} {wrapWithErrorBoundary(, 'account')} {wrapWithErrorBoundary(, 'auth-list')} + {wrapWithErrorBoundary(, 'account-creation')} {wrapWithErrorBoundary(, 'crowdloans')} {wrapWithErrorBoundary(, 'derived-address-locked')} {wrapWithErrorBoundary(, 'derive-address')} + {wrapWithErrorBoundary(, 'export-all-address')} {wrapWithErrorBoundary(, 'export-address')} {wrapWithErrorBoundary(, 'forget-address')} {wrapWithErrorBoundary(, 'forgot-password')} @@ -306,8 +302,12 @@ export default function Popup (): React.ReactElement { {wrapWithErrorBoundary(, 'import-add-watch-only-full-screen')} {wrapWithErrorBoundary(, 'attach-qr')} {wrapWithErrorBoundary(, 'attach-qr-full-screen')} + {wrapWithErrorBoundary(, 'import-ledger-full-screen')} {wrapWithErrorBoundary(, 'import-proxied')} {wrapWithErrorBoundary(, 'import-add-watch-only-full-screen')} + {wrapWithErrorBoundary(, 'import-raw-seed-full-screen')} + {wrapWithErrorBoundary(, 'restore-json-full-screen')} + {wrapWithErrorBoundary(, 'import-seed-full-screen')} {wrapWithErrorBoundary(, 'manage-login-password')} {wrapWithErrorBoundary(, 'manageProxies')} {wrapWithErrorBoundary(, 'manage-identity')}