Skip to content

Commit

Permalink
Add "Add Wallet" button to WalletListScene
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-edge committed Nov 26, 2024
1 parent 7ed490b commit 4ccc703
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

## 4.17.2

- added: "Add Wallet" button to bottom of `WalletListScene`
- fixed: (Zcash/Pirate) Fixed android build issues
- fixed: Default home/assets scene post-login based on last visited scene
- fixed: Receive flip input default currency selection
- removed: Keyboard autofocus from `WalletListModal`

## 4.17.1

Expand Down
13 changes: 11 additions & 2 deletions src/components/scenes/WalletListScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ export function WalletListScene(props: Props) {
navigation.navigate('walletRestore')
})

const handlePressAddWallets = useHandler(() => {
navigation.navigate('createWalletSelectCrypto', {})
})

const tokenSupportingWalletIds = React.useMemo(() => {
const walletIds: string[] = []
for (const wallet of Object.values(account.currencyWallets)) {
Expand Down Expand Up @@ -129,8 +133,13 @@ export function WalletListScene(props: Props) {
if (isSearching && tokenSupportingWalletIds.length > 0) {
return <SceneButtons secondary={{ label: lstrings.add_custom_token, onPress: handlePressAddEditToken }} />
}
return <SceneButtons secondary={{ label: lstrings.restore_wallets_modal_title, onPress: handlePressRestoreWallets }} />
}, [handlePressAddEditToken, handlePressRestoreWallets, tokenSupportingWalletIds, isSearching])
return (
<SceneButtons
primary={{ label: lstrings.wallet_list_add_wallet, onPress: handlePressAddWallets }}
secondary={{ label: lstrings.restore_wallets_modal_title, onPress: handlePressRestoreWallets }}
/>
)
}, [isSearching, tokenSupportingWalletIds.length, handlePressAddWallets, handlePressRestoreWallets, handlePressAddEditToken])

const renderFooter: FooterRender = React.useCallback(
sceneWrapperInfo => {
Expand Down

0 comments on commit 4ccc703

Please sign in to comment.