Skip to content

added Modal component, demo, and docs #47

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rosensteinsamuel1
Copy link

I added the Modal component along with the corresponding demo and docs.

@NehemiahK
Copy link
Owner

Hey, this is neat. Any reason to use refs in this situation? I had initially thought users could just pass in their own open/close function but that would be outside the modal. what do you think?

@rosensteinsamuel1
Copy link
Author

Good idea, I'm going to try a different approach and I'll keep you updated.

@rosensteinsamuel1
Copy link
Author

After thinking about this for a bit I think the best thing is to have defined open/close functionality. If the user wants to run custom functions then we can have props for functions that will execute when the modal is opened/closed. Also, the ref is in order to allow for the modal to close when the background is clicked. If this isn't necessary, I can remove the ref and just have the close functionality via an 'x' button in the corner of the modal.

@rosensteinsamuel1
Copy link
Author

Here is the new version. There aren't any refs. In order to open, set isOpen=true and then the modal closes when the 'close' button is clicked inside of the modal.

@rosensteinsamuel1
Copy link
Author

@NehemiahK Where are we with this?

Copy link
Contributor

@madhuni madhuni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have provided some feedback. Please fix those.


import './Modal.scss';

const Modal = (props) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please destructure the props. Also, make sure the to install the new dependencies using npm install and install the ESLint plugin from this link;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, if required take a pull from the master so that you have the latest code. Rebase your branch with the master and then push the code.

Copy link
Author

@rosensteinsamuel1 rosensteinsamuel1 Jul 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@madhuni Thanks for the insights, I have implemented your suggestions. Regarding ES lint, when I start the project after installing the new dependencies I get an error that CRA uses "eslint": "^6.6.0" and the project uses 7.4.0. Did you see this?
Screen Shot 2020-07-08 at 4 34 02 PM
I deleted the node_modules and package-lock.json and reinstalled but it didn't help. Thanks for the help.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okie let me have a look. Will provide you the solution to resolve this. I didn't see any such problem.

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

Successfully merging this pull request may close these issues.

3 participants