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

Signup Page #55

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Signup Page #55

wants to merge 9 commits into from

Conversation

06unnati
Copy link

@06unnati 06unnati commented Feb 3, 2025

Tracking Info

Resolves #3

Changes

  • I created the sign up page which includes the name, email, password, and the submit button.

Testing

  • ran npm run dev, and went to the local link to see what the output was.

Confirmation of Change

Screenshot (284)

@06unnati 06unnati requested a review from Miyuki-L as a code owner February 3, 2025 06:30
Copy link
Member

@Miyuki-L Miyuki-L left a 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.


import React, { useState } from "react";

interface FormData {
Copy link
Member

Choose a reason for hiding this comment

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

Fix the linter warning

<div className="mb-4">
<label className="block text-sm font-medium mb-1 text-black">Create a Password</label>
<input
type="text"
Copy link
Member

Choose a reason for hiding this comment

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

type="password"

Copy link
Member

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

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

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

image
missing the purple border around linke in the design

and extra color difference around the actual form

see how the design looks from the figma
image

<div className="mb-4">
<label className="block text-sm font-medium mb-1 text-black">Enter your email</label>
<input
type="text"
Copy link
Member

Choose a reason for hiding this comment

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

type="email"

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"
Copy link
Member

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

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>
Copy link
Member

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

@Miyuki-L Miyuki-L requested a review from r800360 February 5, 2025 06:08
Copy link
Member

@r800360 r800360 left a 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!

Copy link
Member

@Miyuki-L Miyuki-L left a 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.

Copy link
Member

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)}>
Copy link
Member

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

Copy link
Member

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

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

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

image
Still doesn't match the designs.

Becaues of the way next.js works

the purple background should be applied conditionally in the layout.tsx page inside the app folder
because layout.tsx adds a padding which the thing giving you a white surrounding


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">
Copy link
Member

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">
Copy link
Member

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

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.

Sign Up Page - Get Started
3 participants