diff --git a/src/components/forms/apply-form.tsx b/src/components/forms/apply-form.tsx index 02719891..05dabeb8 100644 --- a/src/components/forms/apply-form.tsx +++ b/src/components/forms/apply-form.tsx @@ -3,10 +3,13 @@ import { useState } from "react"; import { useForm, SubmitHandler } from "react-hook-form"; import axios from "axios"; import Input from "@ui/form-elements/input"; +import Checkbox from "@ui/form-elements/checkbox"; +import TextArea from "@ui/form-elements/textarea"; import Button from "@ui/button"; import { hasKey } from "@utils/methods"; import Feedback from "@ui/form-elements/feedback"; import { linkedinRegex, githubRegex } from "@utils/formValidations"; +import { motion } from "framer-motion"; interface IFormValues { firstName: string; @@ -19,6 +22,10 @@ interface IFormValues { branchOfService: string; yearJoined: string; yearSeparated: string; + hasAttendedPreviousCourse: boolean; + previousCourses: string; + willAttendAnotherCourse: boolean; + otherCourses: string; linkedInAccountName: string; githubAccountName: string; preworkLink: string; @@ -34,8 +41,12 @@ const ApplyForm = () => { handleSubmit, formState: { errors }, reset, + watch, } = useForm(); + const watchHasAttendedPreviousCourses = watch("hasAttendedPreviousCourse", false); + const watchWillAttendAnotherCourse = watch("willAttendAnotherCourse", false); + const onSubmit: SubmitHandler = async (data) => { try { await axios.post("/api/apply", data); @@ -219,7 +230,67 @@ const ApplyForm = () => { })} /> -
+ +
+ {watchHasAttendedPreviousCourses && ( + + +