Skip to content

Commit 7bf40e4

Browse files
authored
Merge pull request #71 from CS3219-AY2425S1/ms3-frontend
Remove username field from signup form
2 parents bbba0dc + d539853 commit 7bf40e4

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

frontend/src/app/signup/page.tsx

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import { useForm, SubmitHandler, FormProvider } from "react-hook-form";
44
import { Card } from "@/components/ui/card";
55
import { Github } from "lucide-react";
66
import Link from "next/link";
7-
import { User, Lock, Mail } from "lucide-react";
7+
import { Lock, Mail } from "lucide-react";
88
import {
9-
Form,
109
FormItem,
1110
FormLabel,
1211
FormControl,
@@ -20,10 +19,6 @@ import { zodResolver } from "@hookform/resolvers/zod";
2019

2120
const SignupFormSchema = z
2221
.object({
23-
username: z
24-
.string()
25-
.min(2, { message: "Name must be at least 2 characters long." })
26-
.trim(),
2722
email: z.string().email({ message: "Please enter a valid email." }).trim(),
2823
password: z
2924
.string()
@@ -89,30 +84,6 @@ export default function SignUpPage() {
8984
<FormProvider {...methods}>
9085
<form onSubmit={handleSubmit(onSubmit)}>
9186
<div className="flex flex-col gap-y-2">
92-
{/* Username Field */}
93-
<FormField
94-
control={control}
95-
name="username"
96-
render={({ field }) => (
97-
<FormItem>
98-
<FormLabel>Username</FormLabel>
99-
<FormControl>
100-
<div className="relative">
101-
<User className="absolute left-2 top-1/2 transform -translate-y-1/2 text-foreground-100" />
102-
<input
103-
{...field}
104-
placeholder="Username"
105-
className="rounded-md w-full py-2 pl-10 bg-input-foreground text-input"
106-
/>
107-
</div>
108-
</FormControl>
109-
{errors.username && (
110-
<FormMessage>{errors.username.message}</FormMessage>
111-
)}
112-
</FormItem>
113-
)}
114-
/>
115-
11687
{/* Email Field */}
11788
<FormField
11889
control={control}

0 commit comments

Comments
 (0)