Skip to content

feat(offers): offers rail, offers list and offer pages - #72

Merged
roncodes merged 1 commit into
release/v0.1.0from
feat/offers
Oct 7, 2026
Merged

roncodes merged 1 commit into
release/v0.1.0from
feat/offers

Conversation

@roncodes

@roncodes roncodes commented Oct 6, 2026

Copy link
Copy Markdown
Member

Summary

This implements offers and promotions from the redesign prototype. It's stacked on feat/reviews and reads the public promotion details from fleetbase/storefront#116: owner, shareable code, availability, next start, applies_to and weekly schedule.

Home

An Offers rail of banner cards after the categories. The first card uses the brand colour. It shows live offers only and hides itself when there are none. See all opens Offers.

Offers (offers.list, route Offers, deep link offers)

  • Filters: All, % off, Money off, Free delivery, Buy 1 get 1.
  • Featured offer first: a first-order offer, otherwise one with an image.
  • Sections: Ending soon (within 72 hours, soonest first), Ongoing, and Coming up (scheduled, next start first).
  • Rows: image with a discount badge (15%, $8, FREE, 2+1), name, who runs it, and one line on how or when it applies. Examples: "Ends Friday · Applied automatically", "Use code GLOW8", "Starts today at 2 pm".
  • Pull to refresh, loading skeleton, error with retry, and empty states (overall and per filter).

Offer page (offers.detail, route Offer, deep link offers/:offerId)

  • Hero with the discount badge.
  • Banners: "Starts again today at 2 pm. You can shop now…" outside its hours, and "This offer ended on …" once ended.
  • Offer from {store}, linking to the store.
  • How to use it:
    • Code offers: the code, Copy on web, and Apply to my cart when the cart has items. Applying reuses the cart promo-code flow, so refusals show the same specific messages as the cart.
    • Automatic offers: "No code needed".
  • Details: discount and cap, what it applies to (selected items or stores, everything at the store, exclusions), weekly hours ("Mon – Fri, 2 pm – 5 pm", in the viewer's locale), minimum spend and items, first order only, per-customer limit, valid until, and whether it combines with other offers.
  • Footer: Shop the offer / Browse {store}, or See current offers once ended.

Shared code

  • src/commerce/offers.ts: parsing, badges, grouping, the featured pick, schedule text and the store an offer belongs to.
  • OfferBanner / OfferRow in src/components/offers.
  • New screen ids offers.list and offers.detail.

Notes

  • There's no clipboard library, and adding one needs a native rebuild. So Copy is web-only, and native gets Apply to my cart, which does the copy's job directly.
  • The empty state links back to browsing. The notifications PR points it at notification settings.

Testing

  • Unit tests: __tests__/commerce/offers.test.ts.
  • yarn jest: 178 tests pass. yarn typecheck:strict is clean. yarn lint:strict has 0 errors, now also covering the offers files.
  • Web preview with sample promotions served in the page, since the local API has none. Checked:
    • the Offers list (featured, sections, badges, meta lines);
    • the scheduled offer page (start-again banner and all terms);
    • the code offer page (code, Copy, Apply to my cart).

- Home: an Offers rail with banner cards (live offers only) and "See all".
- Offers: kind-of-discount filters, a featured offer (first-order first), then
  offers ending soon, ongoing and coming up, each with its badge, owner and how
  or when it applies.
- Offer page: hero with the discount, "starts again" and "ended" banners, who
  runs it, how to use it (code with copy on web and "Apply to my cart", or
  automatic), and terms: discount and cap, what it applies to, weekly hours,
  minimum, who, limit, valid until and whether it combines.
- src/commerce/offers.ts with tests; offers.list and offers.detail screen ids;
  offers and offers/:offerId deep links.
Base automatically changed from feat/reviews to release/v0.1.0 October 7, 2026 05:42
@roncodes
roncodes merged commit b299124 into release/v0.1.0 Oct 7, 2026
@roncodes
roncodes deleted the feat/offers branch October 7, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant