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
Login & Sign Up pages #1
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The LoadingButton component is still in @mui/lab, therefore I've installed such library for ease-of-use.
This component has two possible styles: button and link. It was inspired by the example provided by MUI (https://github.com/mui/material-ui/blob/HEAD/examples/nextjs-with-typescript/src/Link.tsx). TypeScript shoots out some errors about the ref and properties not being compatible. This is due to the union of the MuiLinkProps and MuiButtonProps. Even it being a tagged union does not seem to make a different. I couldn't figure out how to solve these errors, so I just decided to make TypeScript ignore these lines. It's not the best solution, but maybe in the future I can figure out a way to fix these errors. For now, everything seems to work fine and specific props are recognized beloging to the correct element.
After the adventure down to MUI energy-sucking types, I've decided it's better to switch to another component library. When making edits I had to wait upwards of 5-15secs for the TypeScript errors to update. This made development impossible and completely unefficient. Chakra seems to be a good and popular library, with good amount of components.
A onSubmit prop was added to the LoginForm component to enable easier testing. It might generally be useful in the future to.
I decided to have all the schemas in their own place so the validation is reusable in multiple places. This will also guarantee that the validation stays consistent throughout the app.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Created the pages for login and sign up.
Newly installed dependencies are Chakra UI, Formik, React Icons and Yup.
Initially I had installed Material UI, however it slowed down TypeScript's linting remarkably (view microsoft/TypeScript#34801 and mui/material-ui#19113), making development impossible.