-
Notifications
You must be signed in to change notification settings - Fork 64
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: add reviews count to ProductTitle component #2655
feat: add reviews count to ProductTitle component #2655
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. |
88b85e9
to
7518315
Compare
9c2cebb
to
736e0f8
Compare
622b56f
to
3ab33ce
Compare
cc15cdd
to
33db057
Compare
3ab33ce
to
5999074
Compare
packages/components/src/molecules/ProductTitle/ProductTitle.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/molecules/ProductTitle/ProductTitle.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/molecules/ProductTitle/ProductTitle.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/molecules/ProductTitle/ProductTitle.tsx
Outdated
Show resolved
Hide resolved
packages/core/src/components/sections/ProductDetails/ProductDetails.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/molecules/ProductTitle/ProductTitle.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
Co-authored-by: Fanny Chien <fanny.chien@vtex.com>
Co-authored-by: Fanny Chien <fanny.chien@vtex.com>
Co-authored-by: Fanny Chien <fanny.chien@vtex.com>
Co-authored-by: Fanny Chien <fanny.chien@vtex.com>
Co-authored-by: Fanny Chien <fanny.chien@vtex.com>
packages/core/src/components/sections/ProductDetails/ProductDetails.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
{ratingValue !== undefined && <Rating value={ratingValue} />} | ||
|
||
{reviewsCount !== undefined && ( | ||
<a href="#reviews-and-ratings" data-fs-product-title-reviews> |
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.
just double checking that this is the fixed id, right?
What's the purpose of this pull request?
Adds the number of reviews next to the Rating component in the ProductTitle. The review count, as well as the rating, should only be visible if the corresponding flag in the discovery.config is enabled in the code.
How it works?
The following props have been added to ProductTitle:
The review count text should be a link to the reviews section, which will be located further down on the product page. This link will receive the section ID through the reviewsSectionId prop. The labels for the text can also be customized via props, but by default, they will be "No reviews yet" and "X reviews."
How to test it?
You can access the preview link and open any pdp. It already should be able to show the reviews count for the product.
If the count label don't appear you can run
yarn cms-sync
in thestart.store
branchStarters Deploy Preview
Preview
References
JIRA TASK: SFS-2064
Figma