Repository navigation
feat(offers): offers rail, offers list and offer pages - #72
Merged
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This implements offers and promotions from the redesign prototype. It's stacked on
feat/reviewsand reads the public promotion details from fleetbase/storefront#116: owner, shareable code, availability, next start,applies_toand 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, routeOffers, deep linkoffers)Offer page (
offers.detail, routeOffer, deep linkoffers/:offerId)Shared code
src/commerce/offers.ts: parsing, badges, grouping, the featured pick, schedule text and the store an offer belongs to.OfferBanner/OfferRowinsrc/components/offers.offers.listandoffers.detail.Notes
Testing
__tests__/commerce/offers.test.ts.yarn jest: 178 tests pass.yarn typecheck:strictis clean.yarn lint:stricthas 0 errors, now also covering the offers files.