NehemiahK / fun-react-lib

A fun React Library for practice
https://nehemiahk.github.io/fun-react-lib/
61 stars 24 forks source link

Modal Component #46

Open rosensteinsamuel1 opened 4 years ago

rosensteinsamuel1 commented 4 years ago

Hey all, I would like to implement an example modal component. There would be a button that says 'Open Modal' and it would close when either the 'close' button is clicked or the background behind it is clicked.

NehemiahK commented 4 years ago

Hey I like the idea of having a modal, but I don't think the modal would have a button, since the two are not dependent on one another.

I think it should accept a function for closing the modal, and have a boolean to pass in to have it in the top left corner an x.

Since the use cases for modals is really ranging you want to keep it as reusable as possible.

rosensteinsamuel1 commented 4 years ago

That makes sense, would you mind assigning it to me.