Commit 8990394
feat(rewards): add campaign opt-in flow with details, mechanics, and how-it-works views (#27619)
## Summary
- Adds `CampaignOptInSheet`, `CampaignHowItWorks`,
`CampaignDetailsView`, and `CampaignMechanicsView` components for the
campaign opt-in flow
- Wires new routes (`CampaignDetails`, `CampaignMechanics`) into
`RewardsNavigator`
- Updates `CampaignTile` and `CampaignsPreview` to support opt-in
navigation
- Extends `RewardsController` and `rewards-data-service` with
`CampaignParticipantStatus` handling and revert logic when feature flag
is off
- Adds i18n strings for all new UI
## **Changelog**
CHANGELOG entry: Added campaign opt-in flow with details and mechanics
screens in the Rewards section
## Test plan
- [ ] All 6 test suites pass (80 tests)
- [ ] `yarn format:check` passes
- [ ] ESLint: 0 errors on staged files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Adds new Rewards campaign navigation/screens and changes campaign
opt-in API/controller behavior (including new cache/event logic and 409
handling), which could affect user enrollment state and campaign UI
across the app.
>
> **Overview**
> Adds a new in-app **campaign opt-in flow** in Rewards, including
`CampaignDetailsView` (status/how-it-works + “Join campaign” CTA and
opt-in bottom sheet) and `CampaignMechanicsView` (expanded “how it
works” + parsed notes), plus a reusable `CampaignHowItWorks` renderer.
>
> Wires new routes (`CAMPAIGN_DETAILS`, `CAMPAIGN_MECHANICS`) into
`RewardsNavigator`, updates `CampaignTile` to navigate to details and
show an **“Entered”** state based on participant status, and enhances
`CampaignsPreview` with loading skeleton/spinner and retryable error
banner.
>
> Updates backend plumbing for opt-in: `rewards-data-service` treats
HTTP `409` on opt-in as “already opted in” by fetching participant
status, and `RewardsController.optInToCampaign` only emits
`campaignOptedIn` when transitioning from not-opted-in to opted-in
(reducing redundant refetches), with a small cache-write refactor for
campaigns. Adds corresponding tests and new i18n strings.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
11ee14a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: sophieqgu <sophieqgu@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 285da87 commit 8990394
18 files changed
Lines changed: 1992 additions & 70 deletions
File tree
- app
- components/UI/Rewards
- Views
- components/Campaigns
- core/Engine/controllers/rewards-controller
- services
- locales/languages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
72 | 96 | | |
73 | 97 | | |
74 | 98 | | |
| |||
405 | 429 | | |
406 | 430 | | |
407 | 431 | | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
408 | 445 | | |
409 | 446 | | |
410 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | | - | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
| |||
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
| |||
0 commit comments