diff --git a/src/app/(auth)/layout.tsx b/src/app/(auth)/layout.tsx index 4d34341..18f931b 100644 --- a/src/app/(auth)/layout.tsx +++ b/src/app/(auth)/layout.tsx @@ -1,11 +1,18 @@ -import { Button } from "@/components/ui/button"; +"use client"; + +import Link from "next/link"; import Image from "next/image"; +import { usePathname } from "next/navigation"; +import { Button } from "@/components/ui/button"; interface AuthLayoutProps { children: React.ReactNode; } const AuthLayout = ({ children }: AuthLayoutProps) => { + const pathname = usePathname(); + const isSignIn = pathname === "/sign-in"; + return (
@@ -18,7 +25,11 @@ const AuthLayout = ({ children }: AuthLayoutProps) => { style={{ width: "auto", height: "auto" }} />
- +
diff --git a/src/app/(auth)/sign-in/page.tsx b/src/app/(auth)/sign-in/page.tsx new file mode 100644 index 0000000..a02c5b7 --- /dev/null +++ b/src/app/(auth)/sign-in/page.tsx @@ -0,0 +1,9 @@ +"use client"; + +import { SignInCard } from "@/features/auth/components/sign-in-card"; + +const SignInPage = () => { + return ; +}; + +export default SignInPage; diff --git a/src/app/(auth)/sign-up/page.tsx b/src/app/(auth)/sign-up/page.tsx new file mode 100644 index 0000000..00c76fb --- /dev/null +++ b/src/app/(auth)/sign-up/page.tsx @@ -0,0 +1,9 @@ +"use client"; + +import { SignUpCard } from "@/features/auth/components/sign-up-card"; + +const SignUpPage = () => { + return ; +}; + +export default SignUpPage; diff --git a/src/features/auth/components/sign-in-card.tsx b/src/features/auth/components/sign-in-card.tsx new file mode 100644 index 0000000..3680e4a --- /dev/null +++ b/src/features/auth/components/sign-in-card.tsx @@ -0,0 +1,122 @@ +import { z } from "zod"; +import Link from "next/link"; +import { + Form, + FormControl, + FormField, + FormItem, + FormMessage, +} from "@/components/ui/form"; +import { FcGoogle } from "react-icons/fc"; +import { FaGithub } from "react-icons/fa"; +import { useForm } from "react-hook-form"; +import { Input } from "@/components/ui/input"; +import { Button } from "@/components/ui/button"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { Separator } from "@/components/ui/separator"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; + +const formSchema = z.object({ + email: z.string().email(), + password: z.string().min(1, "Required"), +}); + +export const SignInCard = () => { + const form = useForm>({ + resolver: zodResolver(formSchema), + defaultValues: { + email: "", + password: "", + }, + }); + + const onSubmit = (values: z.infer) => { + console.log({ values }); + }; + + return ( + + + Welcome back ! + +
+ +
+ +
+ + ( + + + + + + + )} + /> + ( + + + + + + + )} + /> + + + +
+
+ +
+ + + + +
+ +
+ +

+ Don't have an account?{" "} + + Sign Up + +

+
+
+ ); +}; diff --git a/src/features/auth/components/sign-up-card.tsx b/src/features/auth/components/sign-up-card.tsx new file mode 100644 index 0000000..9ec130f --- /dev/null +++ b/src/features/auth/components/sign-up-card.tsx @@ -0,0 +1,156 @@ +import { z } from "zod"; +import Link from "next/link"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; +import { + Form, + FormControl, + FormField, + FormItem, + FormMessage, +} from "@/components/ui/form"; +import { FcGoogle } from "react-icons/fc"; +import { FaGithub } from "react-icons/fa"; +import { useForm } from "react-hook-form"; +import { Input } from "@/components/ui/input"; +import { Button } from "@/components/ui/button"; +import { Separator } from "@/components/ui/separator"; +import { zodResolver } from "@hookform/resolvers/zod"; + +const formSchema = z.object({ + name: z.string().trim().min(1, "Required"), + email: z.string().email(), + password: z.string().min(8, "Minimum of 8 characters required"), +}); + +export const SignUpCard = () => { + const form = useForm>({ + resolver: zodResolver(formSchema), + defaultValues: { + name: "", + email: "", + password: "", + }, + }); + + const onSubmit = (values: z.infer) => { + console.log({ values }); + }; + + return ( + + + Sign Up + + By signing up, you're giving a nod to our{" "} + + Privacy Policy + {" "} + and{" "} + + Terms of service + + + +
+ +
+ +
+ + ( + + + + + + + )} + /> + ( + + + + + + + )} + /> + ( + + + + + + + )} + /> + + + +
+
+ +
+ + + + +
+ +
+ +

+ Already have an account?{" "} + + Sign In + +

+
+
+ ); +}; diff --git a/tailwind.config.ts b/tailwind.config.ts index 586d5e2..4d99f4a 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -6,6 +6,7 @@ export default { "./src/pages/**/*.{js,ts,jsx,tsx,mdx}", "./src/components/**/*.{js,ts,jsx,tsx,mdx}", "./src/app/**/*.{js,ts,jsx,tsx,mdx}", + "./src/features/**/*.{js,ts,jsx,tsx,mdx}", ], theme: { extend: {