diff --git a/.env.example b/.env.example index 8e97209..e9cf608 100644 --- a/.env.example +++ b/.env.example @@ -6,4 +6,7 @@ UPLOADTHING_APP_ID= ADMIN_USERNAME= ADMIN_PASSWORD= -NEXTAUTH_SECRET= \ No newline at end of file +NEXTAUTH_SECRET= + +EMAIL= +EMAIL_PASS= \ No newline at end of file diff --git a/app/(root)/contact/page.tsx b/app/(root)/contact/page.tsx new file mode 100644 index 0000000..c2a8315 --- /dev/null +++ b/app/(root)/contact/page.tsx @@ -0,0 +1,148 @@ +"use client"; +import Iconss from "@/components/ui/icons"; +import { MapPin, Phone, Mail, Send } from "lucide-react"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { useForm } from "react-hook-form"; +import { z } from "zod"; +import { contactFormSchema } from "@/lib/validations/validation"; +import { Button } from "@/components/ui/button"; +import { + Form, + FormControl, + FormDescription, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { Textarea } from "@/components/ui/textarea"; +import { sendContactForm } from "@/lib/api/contact"; + +const ContactUs = () => { + const form = useForm>({ + resolver: zodResolver(contactFormSchema), + defaultValues: { + name: "", + email: "", + message: "", + }, + }); + + async function onSubmit(values: z.infer) { + await sendContactForm(values); + console.log(values); + } + + return ( + <> +
+

+ Contact Us +

+
+ +
+
+ {/* Left contact page */} +
+ + ( + + Name + + + + + + )} + /> + ( + + Email + + + + + + )} + /> + ( + + Message + +