-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Price summary updates #1857
Price summary updates #1857
Conversation
f68f320
to
af37867
Compare
@@ -81,7 +78,12 @@ const hasDiscount = (promotion: ?Promotion): boolean %checks => | |||
promotion !== undefined && | |||
isNumeric(promotion.discountedPrice); | |||
|
|||
function applyDiscount(price: Price, promotion: ?Promotion) { | |||
const hasIntroductoryPrice = (promotion: ?Promotion): boolean %checks => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the %
do in this line? I haven't seen this before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is to tell Flow that this is a check, some details (though not many) here: facebook/flow#4723
Seen on PROD (merged by @rupertbates 13 minutes and 37 seconds ago)
Sentry Release: support-client-side, support |
✅ Testing in PROD passed! Details |
Why are you doing this?
We have previously had two types which describe subs product prices;
Price
which had the price and the currency andProductPrice
which had the price and any promotions which were applied.This led to a lot of code mapping between the two and made things complicated when trying to unify the pricing code across components. I have now merged the two types into
ProductPrice
which contains all the fields and used this throughout the subs components.This has also improved the summary component which didn't really cope with 6 for 6 properly before.
Trello Card