From 71045a6d4e9e80b95f9f21b86579f291263531ea Mon Sep 17 00:00:00 2001
From: manacy-keyvalue <112211103+manacy-keyvalue@users.noreply.github.com>
Date: Thu, 21 Dec 2023 14:00:02 +0530
Subject: [PATCH] Fix: Added support for ordering rating summary and fixed
minor issues (#17)
* Added support for ordering rating summary, fixed console error related to svg, updated readMe
* formatted code
---
README.md | 29 ++++++++------
src/assets/star-grey.svg | 1 -
src/constants.ts | 6 +++
src/rating-average/star/Star.tsx | 7 +---
src/rating-summary/RatingSummary.tsx | 56 ++++++++++++++-------------
src/rating-summary/types.d.ts | 3 +-
src/stories/RatingSummary.stories.tsx | 10 +++++
src/tests/ratingSummary.test.tsx | 6 ++-
8 files changed, 71 insertions(+), 47 deletions(-)
diff --git a/README.md b/README.md
index a83d92e..2389e2a 100644
--- a/README.md
+++ b/README.md
@@ -176,7 +176,7 @@ Props that can be passed to the component are listed below:
ratingAverageIconProps?: object
-
An object defining the fill color and background color for customizing the appearance of star icon in the average rating section.
+
An object defining the fill color ( fillColor?: string ) and background color ( bgColor?: string ) for customizing the appearance of star icon in the average rating section.
undefined
@@ -189,6 +189,11 @@ Props that can be passed to the component are listed below:
A string used to customize the text accompanying the star rating average which provides additional information about the total number of reviews.
'reviews'
+
+
order?: 'ORIGINAL' | 'REVERSE'
+
The order prop dictates the summary section's display order. Possible values are: 'ORIGINAL' or 'REVERSE'. For numeric ratingIds, it sorts in ascending (ORIGINAL) or descending (REVERSE) order. For string based ratingIds, it reflects the original/reversed order of keys in the ratings prop.