shekharramola / react-wheel-of-prizes

It is a wheel of prizes game for react developers
90 stars 58 forks source link

Support dynamic width multiple instances #28

Closed sandymcfadden closed 9 months ago

sandymcfadden commented 10 months ago

This updates the component so that the size is more dynamic. It now bases the size of the canvas off either the given size, or the window width if no size is provided.

It also generates random IDs for the canvas and wheel element so that if you wanted you could have more than one on a page and not have conflicts.

There is some code clean up that would make it a bit more type safe if ever converted to TypeScript, which is how I was using it.

mesuhailpm commented 9 months ago

This looks working