-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: basic rating display #2653
base: feat/reviews-and-ratings
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
f86198c
to
1d12420
Compare
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.
LGTM!
const enhancedSku = enhanceSku(sku, product) | ||
|
||
enhancedSku.rating = rating | ||
|
||
return enhancedSku |
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.
suggestion: Could we pass the rating directly here?
const enhancedSku = enhanceSku(sku, product) | |
enhancedSku.rating = rating | |
return enhancedSku | |
const enhancedSku = enhanceSku(sku, { ...product, rating }) | |
return enhancedSku |
@@ -128,7 +128,7 @@ const ProductCardContent = forwardRef<HTMLElement, ProductCardContentProps>( | |||
{includeTaxes && ( | |||
<Label data-fs-product-card-taxes-label>{includeTaxesLabel}</Label> | |||
)} | |||
{ratingValue && ( | |||
{ratingValue != undefined && ( |
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.
suggestion (non-blocking): Since you restricted the value type here, is good to set default value on line 87 (ratingValue = undefined
) just to make sure we won't have any different types here (null
, for instance)
1d12420
to
a561d49
Compare
a561d49
to
160d8be
Compare
What's the purpose of this pull request?
To add rating stars to existing components:
<ProductCardContent/>
<ProductTitle/>
How it works?
If the feature flag for reviews and ratings, defined at
discovery.config
, it's turned on, then everywhere a<ProductCard/>
is used then it will display the product star ratingHow to test it?
preview
References
JIRA TASK: SFS-2063
JIRA TASK: SFS-2065
Checklist
You may erase this after checking them all 😉
PR Description
Just Arrived
Most Wanted
Deals & Promotions
Product Details
Product Gallery