Skip to content

Commit

Permalink
fix(wallet): Back up now Button In Panel Menu (uplift to 1.59.x) (#20100
Browse files Browse the repository at this point in the history
)

Uplift of #20073 (squashed) to beta
  • Loading branch information
brave-builds authored Sep 19, 2023
1 parent 0208e50 commit fd07302
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -223,6 +237,13 @@ export const DefaultPanelMenu = (props: Props) => {
</PopupButtonText>
</PopupButton>

<PopupButton onClick={onClickBackup}>
<ButtonIcon name='safe' />
<PopupButtonText>
{getLocale('braveWalletBackupButton')}
</PopupButtonText>
</PopupButton>

{
selectedNetwork &&
selectedNetwork.coin !== BraveWallet.CoinType.FIL &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ export const BackupEnterPassword: React.FC = () => {
setPassword(value)
}

const goBackUrl =
history.action === 'POP'
? WalletRoutes.PortfolioAssets
: undefined

// render
return (
<CenteredPageLayout>
Expand All @@ -102,6 +107,7 @@ export const BackupEnterPassword: React.FC = () => {
<StepsNavigation
currentStep={WalletRoutes.OnboardingExplainRecoveryPhrase}
steps={[]}
goBackUrl={goBackUrl}
/>

<div>
Expand Down

0 comments on commit fd07302

Please sign in to comment.