Commit ea1cbfe
authored
feat: reward ways to earn for predict (MetaMask#22609)
## **Description**
This PR adds a predict ways to earn cta and bottom sheet. Only if the
required predict feature flag is turned on.
## **Changelog**
CHANGELOG entry: rewards predict ways to earn cta
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/RWDS-787
## **Screenshots/Recordings**
### **After**
<img width="636" height="640" alt="image"
src="https://github.com/user-attachments/assets/63cdf2a6-b005-49fe-b18f-7e4d9cdb1769"
/>
<img width="672" height="521" alt="image"
src="https://github.com/user-attachments/assets/69d43c0b-09ee-4d45-acd1-a12a939ec8b4"
/>
## **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**
- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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]
> Adds a feature-flagged Predict earning option with bottom sheet CTA,
navigation to market list, and metrics tracking, plus comprehensive
tests and i18n strings.
>
> - **Rewards Overview — Ways to Earn**:
> - **Predict entry (feature-flagged)**: Adds `WayToEarnType.PREDICT`,
list item, bottom sheet content, and CTA handling in `WaysToEarn.tsx`.
> - **Navigation**: Predict CTA navigates to `Routes.PREDICT.ROOT` →
`MARKET_LIST`; list filtering honors `selectPredictEnabledFlag`
alongside Card flag.
> - **Metrics**: Tracks `REWARDS_PAGE_BUTTON_CLICKED` and
`REWARDS_WAYS_TO_EARN_CTA_CLICKED` with `ways_to_earn_type` and
`button_type`.
> - **Tests** (`WaysToEarn.test.tsx`):
> - Covers Predict visibility (flag on/off), modal rendering, CTA
navigation, and metrics assertions.
> - Extends existing tests (Swap/Perps/Referral/Card) with metrics
checks and CTA flows; validates enum values and hook configuration.
> - **Localization** (`locales/languages/en.json`):
> - Adds Predict strings under `rewards.ways_to_earn.predict` (titles,
descriptions, sheet, CTA).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8bfc213. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 1cda10b commit ea1cbfe
3 files changed
Lines changed: 233 additions & 5 deletions
File tree
- app/components/UI/Rewards/components/Tabs/OverviewTab/WaysToEarn
- locales/languages
Lines changed: 184 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
38 | 56 | | |
39 | 57 | | |
40 | 58 | | |
| |||
78 | 96 | | |
79 | 97 | | |
80 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
81 | 108 | | |
82 | 109 | | |
83 | 110 | | |
| |||
138 | 165 | | |
139 | 166 | | |
140 | 167 | | |
| 168 | + | |
141 | 169 | | |
142 | 170 | | |
143 | 171 | | |
144 | 172 | | |
145 | 173 | | |
146 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
147 | 182 | | |
148 | 183 | | |
149 | 184 | | |
| |||
154 | 189 | | |
155 | 190 | | |
156 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
157 | 195 | | |
158 | 196 | | |
159 | 197 | | |
| |||
175 | 213 | | |
176 | 214 | | |
177 | 215 | | |
| 216 | + | |
| 217 | + | |
178 | 218 | | |
179 | 219 | | |
180 | 220 | | |
| |||
188 | 228 | | |
189 | 229 | | |
190 | 230 | | |
| 231 | + | |
191 | 232 | | |
192 | 233 | | |
193 | 234 | | |
| |||
203 | 244 | | |
204 | 245 | | |
205 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
206 | 251 | | |
207 | 252 | | |
208 | 253 | | |
| |||
226 | 271 | | |
227 | 272 | | |
228 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
229 | 278 | | |
230 | 279 | | |
231 | 280 | | |
| |||
271 | 320 | | |
272 | 321 | | |
273 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
274 | 327 | | |
275 | 328 | | |
276 | 329 | | |
| |||
410 | 463 | | |
411 | 464 | | |
412 | 465 | | |
| 466 | + | |
413 | 467 | | |
414 | 468 | | |
415 | 469 | | |
416 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
417 | 546 | | |
418 | 547 | | |
419 | 548 | | |
| |||
471 | 600 | | |
472 | 601 | | |
473 | 602 | | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
474 | 658 | | |
Lines changed: 39 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| |||
158 | 166 | | |
159 | 167 | | |
160 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
161 | 184 | | |
162 | 185 | | |
163 | 186 | | |
| |||
182 | 205 | | |
183 | 206 | | |
184 | 207 | | |
| 208 | + | |
185 | 209 | | |
186 | 210 | | |
187 | 211 | | |
| |||
219 | 243 | | |
220 | 244 | | |
221 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
222 | 251 | | |
223 | 252 | | |
224 | 253 | | |
| |||
238 | 267 | | |
239 | 268 | | |
240 | 269 | | |
| 270 | + | |
241 | 271 | | |
242 | 272 | | |
243 | 273 | | |
| |||
274 | 304 | | |
275 | 305 | | |
276 | 306 | | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
282 | 316 | | |
283 | 317 | | |
284 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6752 | 6752 | | |
6753 | 6753 | | |
6754 | 6754 | | |
| 6755 | + | |
| 6756 | + | |
| 6757 | + | |
| 6758 | + | |
| 6759 | + | |
| 6760 | + | |
| 6761 | + | |
| 6762 | + | |
| 6763 | + | |
| 6764 | + | |
6755 | 6765 | | |
6756 | 6766 | | |
6757 | 6767 | | |
| |||
0 commit comments