react-native-star-rating icon indicating copy to clipboard operation
react-native-star-rating copied to clipboard

Support for different Icons

Open abranhe opened this issue 5 years ago • 1 comments

It would be amazing to have the posiblitity to set different icons if the if developer wants to do so, at least up to five. Something like this:

import StarRating from 'react-native-star-rating';

class DifferentIcons extends Component {

  constructor(props) {
    super(props);
    this.state = {
      starCount: 5
    };
  }

  onStarRatingPress(rating) {
    this.setState({
      starCount: rating
    });
  }

  render() {
    return (
      <StarRating
        disabled={false}
        maxStars={5}
		starOne={'$'}
		starTwo={'$$'}
		starThree={'$$$'}
		starFour={'$$$$'}
		starFive={'$$$$$'}
        rating={this.state.starCount}
        selectedStar={(rating) => this.onStarRatingPress(rating)}
      />
    );
  }
}

export default DifferentIcons;

abranhe avatar Mar 16 '19 19:03 abranhe

I created a fork that is able to do this: https://github.com/EricWiener/react-native-star-rating. I'm not going to pull since I don't believe this project is maintained.

EricWiener avatar Apr 28 '19 21:04 EricWiener