woocommerce/plugins/woocommerce-admin/packages/components/src/rating
louwie17 98a55aaeb9 Migrate reviews panel to home screen (https://github.com/woocommerce/woocommerce-admin/pull/5706)
* Create initial reviews panel and displaying it on the home screen

* Update reviews package to support updating and deleting reviews

* Allow custom icons to be defined for rating component

* Add approve, spam, and delete actions to home screen review panel

* Show entire list as updating when items are still in the store

* Update rating to only import the required icons, and allow icons to be passed in instead of strings

* Prune out reviews header panel, as we are not using it anymore

* Showing just a header if collapsible is false for activity panel

* Add tests for reviews panel and accordion changes

* Fix undoing a deleted item by using status - untrash

* Several styling changes to match wireframe as mentioned in PR review

* Moved review rating into the subtitle in relation to new design

* Update clear cache logic for last item

* Remove activity panel unused css

* Use invalideResolution instead of invalidateResolutionForStoreSelector
2020-12-02 09:30:39 -04:00
..
stories Add Storybook for documenting and testing components in isolation (https://github.com/woocommerce/woocommerce-admin/pull/3679) 2020-02-24 15:25:25 +13:00
test Migrate reviews panel to home screen (https://github.com/woocommerce/woocommerce-admin/pull/5706) 2020-12-02 09:30:39 -04:00
README.md Fetch component usage documentation from local README.md. 2019-09-06 11:52:18 -07:00
index.js Migrate reviews panel to home screen (https://github.com/woocommerce/woocommerce-admin/pull/5706) 2020-12-02 09:30:39 -04:00
product.js jsDoc: Fix errors (https://github.com/woocommerce/woocommerce-admin/pull/4985) 2020-08-18 09:36:24 +12:00
review.js jsDoc: Fix errors (https://github.com/woocommerce/woocommerce-admin/pull/4985) 2020-08-18 09:36:24 +12:00
style.scss Update @wordpress/base-styles and replace deprecated variables (https://github.com/woocommerce/woocommerce-admin/pull/4759) 2020-07-17 12:11:42 +12:00

README.md

Rating

Use Rating to display a set of stars, filled, empty or half-filled, that represents a rating in a scale between 0 and the prop totalStars (default 5).

Usage

<Rating rating={ 2.5 } totalStars={ 6 } />

Props

Name Type Default Description
rating Number 0 Number of stars that should be filled. You can pass a partial number of stars like 2.5
totalStars Number 5 The total number of stars the rating is out of
size Number 18 The size in pixels the stars should be rendered at
className String null Additional CSS classes

ProductRating

Display a set of stars representing the product's average rating.

Usage

// Use a real WooCommerce Product here.
const product = { average_rating: 3.5 };

<ProductRating product={ product } />

Props

Name Type Default Description
product Object null (required) A product object containing a average_rating. See https://woocommerce.github.io/woocommerce-rest-api-docs/#products

ReviewRating

Display a set of stars representing the review's rating.

Usage

// Use a real WooCommerce Review here.
const review = { rating: 5 };

<ReviewRating review={ review } />

Props

Name Type Default Description
review Object null (required) A review object containing a rating. See https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-product-reviews