Commit edf69ec
feat(rewards): ondo campaign winner page (#29158)
## Context
Builds on top of #29017 (`feat(rewards): Add ondo campaign winning
toast`). Makes it so the scope of the piece of work for this & the
targeting pr branch is only about the winning view that can be navigated
to from a card/banner shown in stats section on details page OR on
dedicated stats page.
## Changelog
CHANGELOG entry: null
## Screenshots
Winning page, auto opened when qualified and user visits detail page.
Skip for now or X at top right closes/navigates back to detail page.
<img width="492" height="1010" alt="image"
src="https://github.com/user-attachments/assets/2efc875f-c654-4deb-96e0-7afd501a9913"
/>
Primary CTA opens mail and has the winning code in subject
<img width="492" height="1010" alt="image"
src="https://github.com/user-attachments/assets/60cc2033-b90c-427e-9e00-b2225d129f34"
/>
Details page showing banner that you won; tapping it navigates back to
winning page
<img width="492" height="1010" alt="image"
src="https://github.com/user-attachments/assets/bcbaae2e-0df2-45a4-87d0-c23658b93d9f"
/>
Stats page also showing the winning banner. If user skips or taps the x
at top right it closes/navigates back to stats page
<img width="492" height="1010" alt="image"
src="https://github.com/user-attachments/assets/872c31d1-7e3a-4ba8-a947-6f13a066f6aa"
/>
If for some reason the position isn't available and not loading
<img width="901" height="1510" alt="image"
src="https://github.com/user-attachments/assets/db349479-c78f-4a98-abbc-f695ad675efa"
/>
If for some reason the position isn't available and we are loading it
<img width="901" height="1510" alt="image"
src="https://github.com/user-attachments/assets/86d3b7e6-c719-445a-a48b-12ff8a985ba1"
/>
If for some reason the winning code isn't available and we had an error
fetching it
<img width="1004" height="1688" alt="image"
src="https://github.com/user-attachments/assets/48178a90-9957-4876-b26e-174e1107116a"
/>
If for some reason the winning code isn't available and we're loading it
<img width="1004" height="1688" alt="image"
src="https://github.com/user-attachments/assets/cffd4651-86e5-4d51-90fa-cf643241b8d0"
/>
Note there's a animated border effect on the winning banner just like in
the figma design. It loops in an interval.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Adds a new authenticated rewards endpoint and client auto-navigation
to a new winner flow; issues could mis-route users or surface incorrect
winner/claim state if winner detection or API handling is wrong.
>
> **Overview**
> Adds a new `RewardsOndoCampaignWinning` flow for completed Ondo
campaigns, including a dedicated winning screen that displays
rank/return, fetches a per-user winner code, supports copy-to-clipboard,
and launches a prefilled `mailto:` claim email (with retry/error/loading
states).
>
> Updates Ondo campaign details and stats screens to detect *top-5
qualified winners* (`isOndoCampaignWinner`), show a tappable animated
winner banner, and auto-navigate to the winning screen once per session
on screen focus; also threads `campaignName` through stats navigation
and adds route fallback behavior when `campaignId` is missing. Backend
wiring includes new `RewardsController:getOndoCampaignWinnerCode` +
data-service endpoint (`/ondo-gm/:campaignId/winner-code/me`) and
supporting tests/i18n/assets.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
470485c. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: sophieqgu <sophieqgu@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent d0d7530 commit edf69ec
29 files changed
Lines changed: 2254 additions & 57 deletions
File tree
- app
- components/UI/Rewards
- Views
- components/Campaigns
- hooks
- utils
- core/Engine
- controllers/rewards-controller
- services
- messengers/rewards-controller-messenger
- images/rewards
- locales/languages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | | - | |
32 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
| |||
Lines changed: 182 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
33 | 48 | | |
34 | 49 | | |
35 | 50 | | |
| |||
460 | 475 | | |
461 | 476 | | |
462 | 477 | | |
| 478 | + | |
| 479 | + | |
463 | 480 | | |
464 | 481 | | |
465 | 482 | | |
| |||
501 | 518 | | |
502 | 519 | | |
503 | 520 | | |
| 521 | + | |
| 522 | + | |
504 | 523 | | |
505 | 524 | | |
506 | 525 | | |
| |||
1103 | 1122 | | |
1104 | 1123 | | |
1105 | 1124 | | |
1106 | | - | |
| 1125 | + | |
1107 | 1126 | | |
1108 | 1127 | | |
1109 | 1128 | | |
| |||
1264 | 1283 | | |
1265 | 1284 | | |
1266 | 1285 | | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
1267 | 1438 | | |
0 commit comments