-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add reviews count to ProductTitle component (#2655)
## 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**: - **reviewsCount?**: The amount of reviews for the product. - **reviewsSectionId?**: The ID of the reviews section to link to. - **noReviewsText?**: Default text for "No reviews yet." - **reviewsCountText?**: Default text for "X reviews." 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 the `start.store` [branch](vtex-sites/starter.store#685) <!--- Describe the steps with bullet points. Is there any external link that can be used to better test it or an example? ---> ### Starters Deploy Preview [Preview](https://starter-git-feat-preview-product-title-count-vtex.vercel.app/) <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> ## References [JIRA TASK: SFS-2064](https://vtex-dev.atlassian.net/browse/SFS-2064) [Figma](https://www.figma.com/design/YXU6IX2htN2yg7udpCumZv/Reviews-%26-Ratings?node-id=130-32961&t=sKkz60J8JEjxL8m4-4)   --------- Co-authored-by: gutchenzo <[email protected]> Co-authored-by: Larícia Mota <[email protected]> Co-authored-by: Fanny Chien <[email protected]>
- Loading branch information
1 parent
5b1d946
commit 68b05c9
Showing
4 changed files
with
122 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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