Commit 402fccb
authored
feat: metamask pay with send picker (#22363)
## **Description**
Use asset picker from send flow in MetaMask Pay.
Also display disabled entries in token list, including associated
message.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes:
[#6174](MetaMask/MetaMask-planning#6174)
## **Manual testing steps**
## **Screenshots/Recordings**
### **Before**
### **After**
<img width="300" alt="Asset Picker"
src="https://github.com/user-attachments/assets/dffb1e98-32c5-43f7-afd7-8bfadbff07e6"
/>
## **Pre-merge author checklist**
- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Replaces the Pay With modal’s token selector with the Send flow’s
Asset picker, adds disabled-token handling/no-gas messaging, drops the
network selector modal, and updates hooks/types/tests accordingly.
>
> - **UI/UX**:
> - **PayWithModal**: Refactored to BottomSheet using `send/asset`
picker; filters to EVM `ERC20` tokens, shows zero-balance tokens if
required/selected, and disables tokens lacking native gas with
`pay_with_modal.no_gas` message.
> - **Token**: Supports `disabled` state (press disabled, opacity) and
optional `disabledMessage` display.
> - **Asset/TokenList**: New props `hideNfts`, `includeNoBalance`,
`onTokenSelect`, `tokenFilter`; adaptive search placeholder; NFT section
hidden when `hideNfts`.
> - **Navigation**:
> - Removed `Routes.CONFIRMATION_PAY_WITH_NETWORK_MODAL` screen and
references.
> - **Data/Hooks/Types**:
> - `useAccountTokens` accepts `{ includeNoBalance }` to optionally
include zero-balance assets.
> - Added `disabled`/`disabledMessage` to `AssetType`.
> - Removed `useTransactionPayAvailableTokens` hook and its tests.
> - **Localization**:
> - Added strings: `send.search_tokens`, `pay_with_modal.no_gas`.
> - **Tests**:
> - Added/updated tests for PayWithModal filtering/selection, token
disabled behavior, Asset/TokenList props and behavior; removed obsolete
network modal and available-tokens tests.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c264c90. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 7a3407e commit 402fccb
File tree
17 files changed
+435
-712
lines changed- app/components
- Views/confirmations
- components
- UI/token
- modals
- pay-with-modal
- pay-with-network-modal
- send/asset
- token-list
- hooks
- pay
- send
- types
- locales/languages
17 files changed
+435
-712
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
| |||
1052 | 1051 | | |
1053 | 1052 | | |
1054 | 1053 | | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
1058 | | - | |
1059 | 1054 | | |
1060 | 1055 | | |
1061 | 1056 | | |
| |||
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
132 | 177 | | |
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
101 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
102 | 106 | | |
103 | 107 | | |
104 | 108 | | |
| |||
0 commit comments