PlayPickUp / pickup-ui

A collection of React Components that make up the PickUp world. 🌎⚡
https://ui.playpickup.com
3 stars 1 forks source link

feat(checkbox): add checkbox to pickup ui #211

Closed wliederer closed 3 years ago

wliederer commented 3 years ago

Made checkbox for pickup ui

created two tests:

  1. to check to checkbox renders without crashing and matches snapshot
  2. to check that prop checked=boolean can be passed and the box can be clicked and change its checked state.
wliederer commented 3 years ago

Looks good and works internally. However, right now, there's no way for the parent to see the state of the checkbox. I'm thinking it may need a handleChange or onChange prop to receive a function from the parent, maybe lifting state as well if needed.

I added a required onChange function pass that works with internal checkbox state to work with parent state. I looked at the prop-picker when thinking of an implementation for it. Open to other ideas wasnt really sure how to approach this one. I put invisioned implementation in playground.

Let me know what yall think