Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Trigger modal to open based on a prop boolean value #15
This a temporary solution, but think you should implement it better than my solution. This basically triggers the stripe modal to show based on a boolean value. Would prefer to have a prop that triggers the stripe modal to open up without having to click on the button.
Basically I wanted the stripe modal to open after a validation check is done on a form. Once the form was valid then the stripe modal is triggered to open. Currently you only have an
ISSUE: The only issue is that once the modal opens and the user closes it, it won't be opened again. That's because say you have a boolean value in your state that you initially set with
Also, the prop name (showModal) is not a good name. Doesn't communicate that it is a trigger boolean for the modal to open up. So definitely use another name.
Hope this clears what I'm trying to get across.
Hey @muhanad40 thanks for contribution! I'll finally have some time to make some improvements to this component as its now part of my full-time job
Top of the list is making this more "react-like", IE the UI will be a function of the props passed and will no longer depend on clicks and such.
See comments in #28, I've added a new prop