-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e53e09
commit c8acf0f
Showing
11 changed files
with
3,368 additions
and
1,249 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import Link from "next/link" | ||
import { SignupForm } from "@/app/(public)/signup/form" | ||
import Link from 'next/link'; | ||
import { SignupForm } from '@/app/(public)/signup/form'; | ||
export default function Page() { | ||
return ( | ||
<div className="flex items-center w-1/4 px-4 sm:px-6 lg:px-8"> | ||
<div className="w-full mx-auto space-y-8"> | ||
<div className="flex w-1/4 items-center px-4 sm:px-6 lg:px-8"> | ||
<div className="mx-auto w-full space-y-8"> | ||
<div className="space-y-2 text-center"> | ||
<h1 className="text-3xl font-bold">Create an account</h1> | ||
<p className="text-gray-500">Enter your information to get started</p> | ||
</div> | ||
<SignupForm /> | ||
<div className="mt-4 text-center text-sm"> | ||
Already have an account?{" "} | ||
Already have an account?{' '} | ||
<Link className="underline" href="/login"> | ||
Login | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
); | ||
} |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
import { z } from "zod" | ||
import { z } from 'zod'; | ||
|
||
export const SignupFormSchema = z.object({ | ||
name: z | ||
.string() | ||
.min(2, { message: "Name must be at least 2 characters long." }) | ||
.min(2, { message: 'Name must be at least 2 characters long.' }) | ||
.trim(), | ||
email: z.string().email({ message: "Please enter a valid email." }).trim(), | ||
email: z.string().email({ message: 'Please enter a valid email.' }).trim(), | ||
password: z | ||
.string() | ||
.min(8, { message: "Be at least 8 characters long" }) | ||
.regex(/[a-zA-Z]/, { message: "Contain at least one letter." }) | ||
.regex(/[0-9]/, { message: "Contain at least one number." }) | ||
.min(8, { message: 'Be at least 8 characters long' }) | ||
.regex(/[a-zA-Z]/, { message: 'Contain at least one letter.' }) | ||
.regex(/[0-9]/, { message: 'Contain at least one number.' }) | ||
.regex(/[^a-zA-Z0-9]/, { | ||
message: "Contain at least one special character.", | ||
message: 'Contain at least one special character.', | ||
}) | ||
.trim(), | ||
}) | ||
}); | ||
|
||
export const LoginFormSchema = z.object({ | ||
email: z.string().email({ message: "Please enter a valid email" }), | ||
password: z.string().min(1, { message: "Password field must not be empty" }), | ||
}) | ||
email: z.string().email({ message: 'Please enter a valid email' }), | ||
password: z.string().min(1, { message: 'Password field must not be empty' }), | ||
}); | ||
|
||
export type FormState = | ||
| { | ||
errors?: { | ||
name?: string[] | ||
email?: string[] | ||
password?: string[] | ||
} | ||
message?: string | ||
name?: string[]; | ||
email?: string[]; | ||
password?: string[]; | ||
}; | ||
message?: string; | ||
} | ||
| undefined | ||
| undefined; |
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
Oops, something went wrong.