From 2376c4e990e861644f24db0b64152ca2b7d17475 Mon Sep 17 00:00:00 2001 From: pROFESOR11 Date: Tue, 23 Jun 2020 12:18:27 +0300 Subject: [PATCH] fix issue #104 --- README.md | 3 ++- src/SwipeRating.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cbca8b5..29bc675 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Install the package using yarn or npm: ```yarn add react-native-ratings``` OR - + ```npm install --save react-native-ratings``` ## Usage @@ -116,6 +116,7 @@ Also refer to the [`example`](https://github.com/Monte9/react-native-ratings/tre | ratingBackgroundColor | `white` | string (color) | Pass in a custom background-fill-color for the rating icon; use this along with `type='custom'` prop above (optional) | | ratingCount | 5 | number | The number of rating images to display (optional) | | ratingTextColor | none | string | Color used for the text labels | +| emptyBackgroundColor | `white` | string | Color used for the unfilled proportion background | | imageSize | 50 | number | The size of each rating image (optional) | | showRating | none | boolean | Displays the Built-in Rating UI to show the rating value in real-time (optional) | | readonly | false | boolean | Whether the rating can be modiefied by the user | diff --git a/src/SwipeRating.js b/src/SwipeRating.js index 4bb0e60..2d18e4f 100644 --- a/src/SwipeRating.js +++ b/src/SwipeRating.js @@ -129,7 +129,7 @@ export default class SwipeRating extends Component { getSecondaryViewStyle() { const { position } = this.state; - const { imageSize, ratingCount, type } = this.props; + const { imageSize, ratingCount, type, emptyBackgroundColor } = this.props; const backgroundColor = TYPES[type].backgroundColor; @@ -145,7 +145,7 @@ export default class SwipeRating extends Component { ); return { - backgroundColor, + backgroundColor: emptyBackgroundColor || backgroundColor, width, height: width ? imageSize : 0 };