-
Notifications
You must be signed in to change notification settings - Fork 0
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
Signup Page #55
base: main
Are you sure you want to change the base?
Signup Page #55
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great just needs to match the design.
frontend/src/app/signupPage.tsx
Outdated
|
||
import React, { useState } from "react"; | ||
|
||
interface FormData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the linter warning
frontend/src/app/signupPage.tsx
Outdated
<div className="mb-4"> | ||
<label className="block text-sm font-medium mb-1 text-black">Create a Password</label> | ||
<input | ||
type="text" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type="password"
frontend/src/app/signupPage.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add react-hook-form and zod here as well to handle the form data and validate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we put the file under src/app/signup/page.tsx
having the folder signup is what next.js uses to create the routes and page.tsx is the confention for the fiel name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frontend/src/app/signupPage.tsx
Outdated
<div className="mb-4"> | ||
<label className="block text-sm font-medium mb-1 text-black">Enter your email</label> | ||
<input | ||
type="text" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type="email"
frontend/src/app/signupPage.tsx
Outdated
type="submit" | ||
disabled={!isFormValid} | ||
className={`w-30 p-2 rounded-lg font-bold text-white mt-4 ${ | ||
isFormValid ? "bg-blue-500 hover:bg-blue-600" : "bg-gray-300 cursor-not-allowed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong color for the buttons should be the purple button present in throughout the app with the same hover effect color
frontend/src/app/signupPage.tsx
Outdated
return ( | ||
<div className="flex flex-col items-center justify-center min-h-screen p-4 bg-gray-100"> | ||
<div className="w-full max-w-md bg-white p-6 rounded-2xl shadow-md"> | ||
<h1 className="text-2xl font-bold text-left mb-2 text-mainHeading">Get started</h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text is the wrong color
…ng, coloring issues, and type issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Unnati, excellent work on this feature!
Helen is correct in the requested changes in that we need react-hook-form and zod here as well to handle the form data and validate.
A simple example is that I used fields - "Rohan", "Sachdeva", "notANEMAIL", and "notANEMAIL" for the four fields, which incorrectly Signed me up, so the email validation is not handled properly. I am not sure what the specific password requirements are but I see in the code that there is a minimum 8 characters, and other standard requirements that are not handled are:
At least 1 uppercase character.
At least 1 lowercase character.
At least 1 digit.
At least 1 special character.
The use of react-hook-form and zod should make it easier to handle these and other password requirements. I will leave the purple border and extra color difference around the form as issues for you to fix, but I made sure to fix the simpler things Helen described including:
-- moving the file under src/app/signup/page.tsx
-- the linter warning (type
instead of an interface
) - see line 5
-- text color - see lines 45 through 49
-- type="email" - see lines 83 through 94
-- type="password" - see lines 97 through 108
-- Update of color for the buttons to be the purple button presentin throughout the app with the same hover effect color as shown in Figma -- see lines 110 through 125
According to my manual testing, everything seems to still work the same.
On a separate note, it seems there are some issues with backend CI/CD that I will attempt to fix or simply revert for this PR to be merged in.
In summary, all that's left should be:
-- react-hook-form and zod to handle the form data and validate
-- purple border
-- extra color difference around the form
Make sure to pull the changes and best of luck completing the feature!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest writing your own css for the future as opossed to leveraging tailwind unless you really understand how to use tailwind and its applied rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep the original page.tsx file.
<div className="w-full max-w-md bg-white p-6 rounded-2xl shadow-md"> | ||
<h1 className="text-2xl font-bold text-left mb-2 text-primary">Get started</h1> | ||
<p className="text-left text-gray-600 mb-6">Welcome to SPAGen</p> | ||
<form onSubmit={handleSubmit(onSubmit)}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To resolve this linter error you might need to do
const handleFormSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
void handleSubmit(onSubmit)();
};
and call this new function here instead of handleSubmit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no package files in the root
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no backage files in the root. did you install react-hook-form by mistake in the root?
This should be in the frontend folder and react-hook-form is missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
return ( | ||
<div className="flex flex-col items-center justify-center min-h-screen p-4 bg-primary"> | ||
<div className="w-full max-w-md bg-white p-6 rounded-2xl shadow-md"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having the max-w-md makes the component width too small
}; | ||
|
||
return ( | ||
<div className="flex flex-col items-center justify-center min-h-screen p-4 bg-primary"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
min-h-screen here is plus the padding added by the layout.tsx is causing the screen to scroll which is not what we want
Tracking Info
Resolves #3
Changes
Testing
Confirmation of Change