Commit ba14ec4
authored
fix: cash buy button action (#25719)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
The `onBuy` handler drilled down to those components already handles all
the logic to navigate correctly, so fallbacks and modals are removed
from both the new button layout and the "More" menu.
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Fixed flow for "Cash buy X" button on the new token
details layout
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **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]
> **Medium Risk**
> Touches buy-call-to-action wiring and removes embedded ramp
routing/analytics, which could change purchase entrypoints and event
reporting if callers don’t supply `onBuy` correctly.
>
> **Overview**
> Fixes the token details **“Cash buy”** flow by making `onBuy` a
required callback and invoking it directly from both the main
`TokenDetailsActions` button and the `MoreTokenActionsMenu`, removing
internal fallback navigation to fund/ramp flows.
>
> Cleans up related ramp-specific logic and metrics/tracing in the
more-actions menu, and adjusts the token-hide metric to use
`asset.chainId` for `chain_id` instead of the selected network chain id.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1646360. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent af8fe0d commit ba14ec4
2 files changed
Lines changed: 10 additions & 149 deletions
Lines changed: 6 additions & 111 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | | - | |
14 | | - | |
15 | 12 | | |
16 | 13 | | |
17 | 14 | | |
18 | 15 | | |
19 | | - | |
20 | 16 | | |
21 | | - | |
22 | 17 | | |
23 | | - | |
24 | | - | |
25 | 18 | | |
26 | 19 | | |
27 | 20 | | |
| |||
34 | 27 | | |
35 | 28 | | |
36 | 29 | | |
37 | | - | |
| 30 | + | |
38 | 31 | | |
39 | 32 | | |
40 | 33 | | |
| |||
65 | 58 | | |
66 | 59 | | |
67 | 60 | | |
68 | | - | |
| 61 | + | |
69 | 62 | | |
70 | 63 | | |
71 | 64 | | |
72 | 65 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | 66 | | |
78 | | - | |
79 | 67 | | |
80 | 68 | | |
81 | 69 | | |
| |||
101 | 89 | | |
102 | 90 | | |
103 | 91 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
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 | 92 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 93 | + | |
| 94 | + | |
197 | 95 | | |
198 | 96 | | |
199 | 97 | | |
| |||
251 | 149 | | |
252 | 150 | | |
253 | 151 | | |
254 | | - | |
| 152 | + | |
255 | 153 | | |
256 | 154 | | |
257 | 155 | | |
| |||
270 | 168 | | |
271 | 169 | | |
272 | 170 | | |
273 | | - | |
274 | 171 | | |
275 | 172 | | |
276 | 173 | | |
| |||
297 | 194 | | |
298 | 195 | | |
299 | 196 | | |
300 | | - | |
| 197 | + | |
301 | 198 | | |
302 | 199 | | |
303 | 200 | | |
| |||
334 | 231 | | |
335 | 232 | | |
336 | 233 | | |
337 | | - | |
338 | 234 | | |
339 | 235 | | |
340 | | - | |
341 | 236 | | |
342 | 237 | | |
343 | 238 | | |
| |||
Lines changed: 4 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 13 | | |
21 | 14 | | |
22 | 15 | | |
| |||
45 | 38 | | |
46 | 39 | | |
47 | 40 | | |
48 | | - | |
| 41 | + | |
49 | 42 | | |
50 | 43 | | |
51 | 44 | | |
| |||
93 | 86 | | |
94 | 87 | | |
95 | 88 | | |
96 | | - | |
97 | 89 | | |
98 | 90 | | |
99 | 91 | | |
| |||
121 | 113 | | |
122 | 114 | | |
123 | 115 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 116 | + | |
| 117 | + | |
151 | 118 | | |
152 | 119 | | |
153 | 120 | | |
| |||
213 | 180 | | |
214 | 181 | | |
215 | 182 | | |
216 | | - | |
| 183 | + | |
217 | 184 | | |
218 | 185 | | |
219 | 186 | | |
| |||
322 | 289 | | |
323 | 290 | | |
324 | 291 | | |
325 | | - | |
326 | 292 | | |
327 | 293 | | |
328 | 294 | | |
| |||
0 commit comments