From fd0730202a45b6a03ecee2973f9aa341a517befb Mon Sep 17 00:00:00 2001 From: brave-builds <45370463+brave-builds@users.noreply.github.com> Date: Wed, 20 Sep 2023 02:10:07 +0900 Subject: [PATCH] fix(wallet): Back up now Button In Panel Menu (uplift to 1.59.x) (#20100) Uplift of #20073 (squashed) to beta --- .../wallet-menus/default-panel-menu.tsx | 21 +++++++++++++++++++ .../backup-enter-password.tsx | 6 ++++++ 2 files changed, 27 insertions(+) diff --git a/components/brave_wallet_ui/components/desktop/wallet-menus/default-panel-menu.tsx b/components/brave_wallet_ui/components/desktop/wallet-menus/default-panel-menu.tsx index d51c360057bd..9f76547cd2a7 100644 --- a/components/brave_wallet_ui/components/desktop/wallet-menus/default-panel-menu.tsx +++ b/components/brave_wallet_ui/components/desktop/wallet-menus/default-panel-menu.tsx @@ -207,6 +207,20 @@ export const DefaultPanelMenu = (props: Props) => { history.push(route) } + const onClickBackup = () => { + chrome.tabs.create( + { + url: `chrome://wallet${WalletRoutes.Backup}` + }, () => { + if (chrome.runtime.lastError) { + console.error( + 'tabs.create failed: ' + + chrome.runtime.lastError.message + ) + } + }) + } + const showPortfolioSettings = walletLocation === WalletRoutes.PortfolioNFTs || walletLocation === WalletRoutes.PortfolioAssets @@ -223,6 +237,13 @@ export const DefaultPanelMenu = (props: Props) => { + + + + {getLocale('braveWalletBackupButton')} + + + { selectedNetwork && selectedNetwork.coin !== BraveWallet.CoinType.FIL && diff --git a/components/brave_wallet_ui/page/screens/backup-wallet/backup-enter-password/backup-enter-password.tsx b/components/brave_wallet_ui/page/screens/backup-wallet/backup-enter-password/backup-enter-password.tsx index 1284a8ee1e75..eabd1dbc2893 100644 --- a/components/brave_wallet_ui/page/screens/backup-wallet/backup-enter-password/backup-enter-password.tsx +++ b/components/brave_wallet_ui/page/screens/backup-wallet/backup-enter-password/backup-enter-password.tsx @@ -93,6 +93,11 @@ export const BackupEnterPassword: React.FC = () => { setPassword(value) } + const goBackUrl = + history.action === 'POP' + ? WalletRoutes.PortfolioAssets + : undefined + // render return ( @@ -102,6 +107,7 @@ export const BackupEnterPassword: React.FC = () => {