Commit 1e0be21
authored
feat: update prediction market cards to match latest design (#26795)
## **Description**
Updates the prediction market cards on the homepage to match the latest
Figma design specs
([TMCU-483](https://consensyssoftware.atlassian.net/browse/TMCU-483)):
- **Outcome percentages as plain text**: Replaced `Button` components
with `Text` to show outcome probabilities (e.g. "55%") as
alternative-colored text without a background, matching the simplified
card design.
- **Removed date display**: Removed the `formatDate` helper and end-date
rendering from cards.
- **Reduced card width**: From 280px to 240px for a more compact
carousel layout.
- **Smaller outcome images**: From 32px to 24px thumbnails.
- **Consistent card heights**: Added `flex-1` and `justifyContent:
spaceBetween` so all cards in the carousel share the same height
regardless of title length.
- **ViewMoreCard flex alignment**: Changed from fixed `h-[180px]` to
`flex-1` so it matches sibling card heights.
- **Updated skeleton loader**: Aligned `PredictMarketCardSkeleton`
dimensions (width, gaps, image/text placeholder sizes) with the new card
layout.
## **Changelog**
CHANGELOG entry: Updated prediction market card design with smaller
cards, plain-text percentages, and consistent heights
## **Related issues**
Refs:
[TMCU-483](https://consensyssoftware.atlassian.net/browse/TMCU-483)
## **Manual testing steps**
```gherkin
Feature: Prediction market cards on homepage
Scenario: user views trending prediction markets carousel
Given user is on the homepage with no prediction positions
And the Predictions feature flag is enabled
When user scrolls to the Predictions section
Then prediction market cards display at 240px width
And each card shows a title and up to 2 outcomes with percentage text (not buttons)
And all cards in the carousel have the same height
And a "More predictions" card appears at the end of the carousel
Scenario: user sees skeleton loading state
Given user is on the homepage
And prediction markets are loading
When user scrolls to the Predictions section
Then skeleton placeholders match the new card dimensions
```
## **Screenshots/Recordings**
### **Before**
https://github.com/user-attachments/assets/6426ebbd-608e-4e23-ad1e-b905bf1a45c8
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/8f66556d-bd91-48cc-b73f-70c1618eeb52
## **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.
[TMCU-483]:
https://consensyssoftware.atlassian.net/browse/TMCU-483?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TMCU-483]:
https://consensyssoftware.atlassian.net/browse/TMCU-483?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Primarily UI/layout changes to the homepage predictions carousel (card
sizing, alignment, and display), with no changes to data fetching or
navigation logic.
>
> **Overview**
> Updates the homepage Predictions carousel to match the latest card
design by shrinking market cards (and snap offsets) from 280px to 240px
and making the end `ViewMoreCard` use `flex-1` for consistent height.
>
> Simplifies `PredictMarketCard` UI by removing end-date rendering and
replacing outcome price `Button`s with plain percentage `Text`, while
adjusting spacing and thumbnail sizes; the skeleton loader is updated to
mirror the new layout.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f65e8f7. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent fc16f7a commit 1e0be21
3 files changed
Lines changed: 36 additions & 79 deletions
File tree
- app/components/Views/Homepage/Sections/Predictions
- components
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| |||
Lines changed: 26 additions & 66 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 16 | | |
20 | 17 | | |
21 | 18 | | |
| |||
29 | 26 | | |
30 | 27 | | |
31 | 28 | | |
32 | | - | |
| 29 | + | |
33 | 30 | | |
34 | 31 | | |
35 | | - | |
36 | | - | |
| 32 | + | |
| 33 | + | |
37 | 34 | | |
38 | 35 | | |
39 | 36 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 37 | + | |
55 | 38 | | |
56 | 39 | | |
57 | 40 | | |
58 | | - | |
59 | | - | |
| 41 | + | |
60 | 42 | | |
61 | 43 | | |
62 | 44 | | |
| |||
68 | 50 | | |
69 | 51 | | |
70 | 52 | | |
71 | | - | |
| 53 | + | |
72 | 54 | | |
73 | 55 | | |
74 | 56 | | |
75 | | - | |
| 57 | + | |
76 | 58 | | |
77 | 59 | | |
78 | 60 | | |
| |||
82 | 64 | | |
83 | 65 | | |
84 | 66 | | |
85 | | - | |
86 | 67 | | |
87 | 68 | | |
88 | 69 | | |
89 | 70 | | |
90 | 71 | | |
91 | 72 | | |
92 | 73 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
100 | 78 | | |
101 | 79 | | |
102 | 80 | | |
103 | 81 | | |
104 | 82 | | |
105 | 83 | | |
106 | | - | |
| 84 | + | |
107 | 85 | | |
108 | 86 | | |
109 | 87 | | |
| |||
116 | 94 | | |
117 | 95 | | |
118 | 96 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | 97 | | |
125 | 98 | | |
126 | 99 | | |
| |||
150 | 123 | | |
151 | 124 | | |
152 | 125 | | |
153 | | - | |
| 126 | + | |
154 | 127 | | |
155 | | - | |
| 128 | + | |
| 129 | + | |
156 | 130 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
176 | 140 | | |
177 | 141 | | |
178 | 142 | | |
179 | 143 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 144 | + | |
185 | 145 | | |
186 | 146 | | |
187 | 147 | | |
| |||
Lines changed: 8 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
27 | 24 | | |
28 | 25 | | |
29 | 26 | | |
30 | 27 | | |
31 | 28 | | |
32 | | - | |
| 29 | + | |
33 | 30 | | |
34 | 31 | | |
35 | 32 | | |
36 | | - | |
| 33 | + | |
37 | 34 | | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
41 | | - | |
| 38 | + | |
42 | 39 | | |
43 | 40 | | |
44 | 41 | | |
45 | | - | |
| 42 | + | |
46 | 43 | | |
47 | 44 | | |
48 | 45 | | |
| |||
0 commit comments