Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Custom Images as Rating #5

Closed
Relax594 opened this issue Jul 10, 2020 · 6 comments · Fixed by #6
Closed

[Feature Request] Custom Images as Rating #5

Relax594 opened this issue Jul 10, 2020 · 6 comments · Fixed by #6
Assignees
Labels
enhancement New feature or request

Comments

@Relax594
Copy link
Contributor

Instead of defining just an icon, let us define a type with ["icon", "custom"] (defaults to icon) and if we set the type to custom, we can use an custom image (for example a .png file). This way we would be able to setup something like this:
Unbenannt

Thanks a lot!

@ui-ninja ui-ninja added the enhancement New feature or request label Jul 10, 2020
@ui-ninja
Copy link
Owner

ui-ninja commented Jul 10, 2020

@Relax594
Images are always a problem.. it was the reason why I created this tiny library.
Especially when we think in terms of wrapping <Rating /> inside <TocuhableOpacity />, width/height scaling of image, background color leakage etc etc.

I faced similar issues on existing libraries like this

But let me think and analyse more over weekend..and see if this can be something which will add more value to library.

@Relax594
Copy link
Contributor Author

Relax594 commented Jul 10, 2020

I modified the react-native-ratings repo (which is used in React-Native-Elements) to make it work like in my picture posted above. The way it works is the same as the way you do it in this repo. I just added a PNG which is transparent fill and has a border. A second layer with the fill-color is growing in height or width depending on rating.

Having this feature in this library would allow me to get rid of react-native-ratings, which is kinda abandoned.

@ui-ninja
Copy link
Owner

@Relax594 ok! will check and revert..
should not be a big thing to implement.

@ui-ninja ui-ninja self-assigned this Jul 10, 2020
@ui-ninja
Copy link
Owner

@Relax594
Check v5.1.0

  • onStarTap changed to onIconTap
  • support added for custom image

@ui-ninja
Copy link
Owner

@Relax594 I am closing this request as requested feature is added and released in v5.1.0.
Feel free to reopen if request not fulfilled.

@ui-ninja ui-ninja linked a pull request Jul 10, 2020 that will close this issue
@Relax594
Copy link
Contributor Author

Relax594 commented Jul 10, 2020

Looks really solid! Appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants