Skip to content

Commit 1590c5e

Browse files
author
Rishabh
committed
changing default rating and background colors
1 parent 9d225eb commit 1590c5e

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ import { Rating } from "react-native-rating-element";
3030
<Rating
3131
rated={3.7}
3232
totalCount={5}
33-
ratingColor="#b5121b"
34-
ratingBackgroundColor="#c8c7c8"
33+
ratingColor="#f1c644"
34+
ratingBackgroundColor="#d4d4d4"
3535
size={24}
3636
readonly
3737
icon="ios-star"
@@ -55,8 +55,8 @@ import { Rating } from "react-native-rating-element";
5555
<Rating
5656
rated={3.7}
5757
totalCount={5}
58-
ratingColor="#b5121b"
59-
ratingBackgroundColor="#c8c7c8"
58+
ratingColor="#f1c644"
59+
ratingBackgroundColor="#d4d4d4"
6060
size={24}
6161
onIconTap={position => console.log(`User pressed: ${position}`)}
6262
icon="ios-star"
@@ -73,8 +73,8 @@ import { Rating } from "react-native-rating-element";
7373
| `type` | `icon` | string | Be default the value is set to "icon" type. If you want custom images, then pass `custom` as prop value. <br />In case of `custom`, Make sure to pass `selectedIconImage` and `emptyIconImage`. | |
7474
| `rated` | 0 | number | Represents Initial value for the rating. |
7575
| `totalCount` | 5 | number | Number of background stars to show. For ex. Rated 5 out of 10 stars. The 10 value is `totalCount` |
76-
| `ratingColor` | #b5121b | string (color) | Pass in a custom color to fill-color the rating icon. |
77-
| `ratingBackgroundColor` | #c8c7c8 | string (color) | Pass in a custom fill-color for the background of rating icon. It is sometimes referred as empty icon. |
76+
| `ratingColor` | #f1c644 | string (color) | Pass in a custom color to fill-color the rating icon. |
77+
| `ratingBackgroundColor` | #d4d4d4 | string (color) | Pass in a custom fill-color for the background of rating icon. It is sometimes referred as empty icon. |
7878
| `size` | 24 | number | Pass in a custom font size for the icon |
7979
| `icon` | 'ios-star' | string | Pass in a custom text for the icon. For ex. 'beer', 'bulb'. These icons are imported from package [react-native-vector-icons](https://oblador.github.io/react-native-vector-icons/). Please Note: For now this package only support Ionicons |
8080
| `marginBetweenRatingIcon` | 1 | number | Pass in custom number to manage space or margin between the rating icons. |

src/Rating/components/IconBar.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ const IconBar = ({
4040
size={size}
4141
/>
4242
) : (
43-
<StyledIcon name={name} size={size} color={color} margin={margin} />
43+
<StyledIcon
44+
name={name}
45+
size={size}
46+
color={color}
47+
margin={margin}
48+
/>
4449
)}
4550
</TouchableOpacity>
4651
);

src/Rating/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ const Rating = ({
8989
Rating.defaultProps = {
9090
rated: 0,
9191
totalCount: 5,
92-
ratingColor: "#b5121b",
93-
ratingBackgroundColor: "#c8c7c8",
92+
ratingColor: "#f1c644",
93+
ratingBackgroundColor: "#d4d4d4",
9494
size: 12,
9595
icon: "ios-star",
9696
marginBetweenRatingIcon: 1,

0 commit comments

Comments
 (0)