feat(promotions): PROMO-1507 add featured promotions callout to pdp and plp #3057
Conversation
🦋 Changeset detectedLatest commit: 5f33ad6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle Size ReportComparing against baseline from
Per-Route First Load JS
|
587f0a7 to
a1c841d
Compare
Unlighthouse Performance Comparison — VercelComparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores. Summary ScoreAggregate score across all categories as reported by Unlighthouse.
Category Scores
Core Web Vitals
|
a1c841d to
7d235d4
Compare
7d235d4 to
773bae3
Compare
773bae3 to
3c11f1f
Compare
3c11f1f to
76736d1
Compare
|
Code looks good but design seems off. @andrewreifman do you have input on this? |
|
So @hunterbecton just released a Callout component into Storefrontkit to be used within PLP and PDP that was requested by others on the TRAC team, but this appears to be a different type of component and use case. Based on the screenshots above, this look more like the Banner, but supporting multiple items/text instead of just one. |
6f99f72 to
2e968cb
Compare
2e968cb to
e117655
Compare
e117655 to
f6d4bfa
Compare
f6d4bfa to
4a7216e
Compare
|
@jorgemoya and @andrewreifman Thanks for pointing out about the callout component and outdated designs. |
…nd plp using mock data
…n PDP and PLP pages
…t on PDP and PLP pages
4a7216e to
5f33ad6
Compare
|
|
parthshahp
left a comment
There was a problem hiding this comment.
Approved, non-blocking question.
| {promotions != null && promotions.length > 0 && ( | ||
| <div className="mt-1.5"> | ||
| <CalloutRoot | ||
| className="items-start rounded-md border border-yellow-300 bg-yellow-50 px-2.5 py-1.5" | ||
| size="small" | ||
| variant="warning" | ||
| > | ||
| <CalloutContent> | ||
| <CalloutHeader> | ||
| <CalloutTitle className="text-xs font-semibold leading-snug text-yellow-900"> | ||
| {promotions[0]?.text ?? ''} | ||
| </CalloutTitle> | ||
| {promotions.length > 1 && ( | ||
| <CalloutDescription className="text-xs text-yellow-900/70"> | ||
| +{promotions.length - 1} {moreOffersLabel} | ||
| </CalloutDescription> | ||
| )} | ||
| </CalloutHeader> | ||
| </CalloutContent> | ||
| </CalloutRoot> | ||
| </div> | ||
| )} |
There was a problem hiding this comment.
🍹 I wonder if this is better as a separate component?
There was a problem hiding this comment.
It's intentionally inline — the block is small and directly composes storefront-kit's Callout primitives without custom logic. Extracting it to a separate component would only make sense if it were reused, but promotion callout styling varies per context (card vs. PDP), so a shared component would need its own props and variants anyway. Not worth the indirection at this size.
Linear: PROMO-1507
What/Why?
Wire promotion callouts into PDP and PLP pages using live data from the Storefront GraphQL API (
featuredPromotionson theProducttype).Rollout/Rollback
Revert.
Testing
testing notes / screenshots:
Migration
None.