Commit 64d0890
authored
feat(predict): update sports market card UI (#30195)
## **Description**
Updates the Predict sports/game market card UI for World Cup match
markets to match the provided Figma designs and aligns the game details
footer action buttons with the same button treatment.
This includes:
- Reworking `PredictMarketSportCard` to use the sports match card layout
with team logos, scheduled/live states, draw support, and inline
team-colored outcome buttons.
- Adding guarded buy-sheet handling directly from the sport card outcome
buttons.
- Adding an `inlineNoSeparator` action-button layout so
`PredictGameDetailsFooter` buttons match the card button format (`CAN
55¢`, `DRAW 24¢`, `BIH 22¢`).
- Updating focused tests for sport card rendering, buy actions, live
state, and footer/action-button layouts.
## **Changelog**
CHANGELOG entry: Updated World Cup prediction cards and game detail
action buttons to match the sports match design.
## **Related issues**
Fixes: PRED-875, PRED-866
## **Manual testing steps**
```gherkin
Feature: World Cup sports match cards
Scenario: user views World Cup match markets
Given the Predict World Cup feed contains match/game markets
When user opens the World Cup feed
Then each game market is displayed with team logos, match schedule/live state, and team-colored outcome buttons
Scenario: user opens a World Cup game detail screen
Given user taps a World Cup match card
When the game details screen opens
Then the bottom prediction buttons match the card button treatment with inline label and cents price
```
## **Screenshots/Recordings**
### **Before**
N/A
### **After**
https://github.com/user-attachments/assets/37ccf11c-b865-4a86-8c9a-cb84d242a7d2
## **Validation**
- `yarn lint:tsc --pretty false`
- Focused ESLint on changed files
- `yarn jest
app/components/UI/Predict/components/PredictMarketSportCard/PredictMarketSportCard.test.tsx
app/components/UI/Predict/components/PredictMarketSportCard/PredictMarketSportCardWrapper.test.tsx
--runInBand`
- `yarn jest
app/components/UI/Predict/components/PredictActionButtons/PredictBetButton.test.tsx
app/components/UI/Predict/components/PredictActionButtons/PredictBetButtons.test.tsx
app/components/UI/Predict/components/PredictActionButtons/PredictActionButtons.test.tsx
app/components/UI/Predict/components/PredictGameDetailsFooter/PredictGameDetailsFooter.test.tsx
--runInBand`
## **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.
#### Performance checks (if applicable)
- [ ] I've tested on Android
- Ideally on a mid-range device; emulator is acceptable
- [ ] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example
For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).
## **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**
> Moderate risk due to a substantial rewrite of `PredictMarketSportCard`
rendering and new guarded buy-sheet trigger paths that could affect
navigation and bet entry UX.
>
> **Overview**
> Updates Predict’s sports match presentation by **rewriting
`PredictMarketSportCard`** to a new layout with team logos, scheduled vs
live states (including live score updates), optional draw support, and
inline outcome buttons that can open the preview/buy sheet via guarded
actions.
>
> Extends action button APIs to support a new `inlineNoSeparator` layout
plus customizable container/gap styling, and applies this in
`PredictGameDetailsFooter` so footer bet buttons match the card’s “TEAM
60¢” format.
>
> Adds the `PulsingLiveDot` component and adjusts World Cup tabs to use
it for live indicators; updates and refocuses tests to cover the new
card rendering, buy-button behavior, and button layout variants.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
2eb4496. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 8fbb9a4 commit 64d0890
12 files changed
Lines changed: 827 additions & 517 deletions
File tree
- app/components/UI/Predict
- components
- PredictActionButtons
- PredictMarketSportCard
- PulsingLiveDot
- views/PredictWorldCup
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
| |||
172 | 178 | | |
173 | 179 | | |
174 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
175 | 184 | | |
176 | 185 | | |
177 | 186 | | |
| |||
184 | 193 | | |
185 | 194 | | |
186 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
187 | 199 | | |
188 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
189 | 209 | | |
190 | 210 | | |
191 | 211 | | |
| |||
202 | 222 | | |
203 | 223 | | |
204 | 224 | | |
205 | | - | |
| 225 | + | |
206 | 226 | | |
207 | 227 | | |
208 | 228 | | |
| |||
217 | 237 | | |
218 | 238 | | |
219 | 239 | | |
| 240 | + | |
| 241 | + | |
220 | 242 | | |
221 | 243 | | |
222 | 244 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
60 | 65 | | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
177 | 189 | | |
178 | 190 | | |
179 | 191 | | |
| |||
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
| |||
51 | 59 | | |
52 | 60 | | |
53 | 61 | | |
54 | | - | |
55 | | - | |
56 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
57 | 71 | | |
58 | 72 | | |
59 | 73 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | | - | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
| |||
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 190 | + | |
| 191 | + | |
194 | 192 | | |
195 | 193 | | |
196 | 194 | | |
| |||
200 | 198 | | |
201 | 199 | | |
202 | 200 | | |
203 | | - | |
204 | | - | |
| 201 | + | |
| 202 | + | |
205 | 203 | | |
206 | 204 | | |
207 | 205 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
| |||
0 commit comments