Skip to content
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

Added isPreviewMode + code organization and formatting. #5

Merged
merged 2 commits into from
May 9, 2021

Conversation

lucasew
Copy link
Contributor

@lucasew lucasew commented May 6, 2021

isPreviewMode is a simple function exposed to inside the components to check if the note is in preview mode.

There is a rule that in React you must call the same hooks at every render so early returns are not good.

The user can easily check if the note is on preview mode inside its component and can return null if it's the case.

Solves #4

…he console

Signed-off-by: lucasew <lucas59356@gmail.com>
Signed-off-by: lucasew <lucas59356@gmail.com>
@elias-sundqvist
Copy link
Owner

Thank you for contributing :)
I will check your code tomorrow.

One worry I have regarding formatting is that different contributors may have different vscode configurations.
I would prefer if the PR diff only contains changes relevant to the functionality.

I created an issue for setting up prettier and eslint configs here: #6 .
I'd like to close that issue before merging this PR.

@lucasew
Copy link
Contributor Author

lucasew commented May 8, 2021 via email

@elias-sundqvist
Copy link
Owner

I have tested the code now. Your changes look good 👍
I thought I found a bug, but turns out that it's present in my code as well.
I will merge this now. Thanks again for contributing 🙂

@elias-sundqvist elias-sundqvist merged commit e896b24 into elias-sundqvist:master May 9, 2021
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.

2 participants