-
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?
Changes from all commits
346c37b
165333d
2e032d2
7a206e7
6a7a97a
534516b
160d8be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
type StoreProductRating { | ||
""" | ||
Product average rating. | ||
""" | ||
average: Float! | ||
""" | ||
Product amount of ratings received. | ||
""" | ||
totalCount: Int! | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is typed as |
||
<Rating value={ratingValue} icon={<Icon name="Star" />} /> | ||
)} | ||
</div> | ||
|
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?
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.
my intention was to not change the method signature. I didn't want to introduce a break change for all the calls.
do you thing this is a must do ?