From aeeb319d483d4c50ed81a470b06ca116050a18ed Mon Sep 17 00:00:00 2001 From: Ar Rakin <68149013+virtual-designer@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:34:47 +0000 Subject: [PATCH] feat: add more fields to GeneralHelpForm Signed-off-by: GitHub --- src/features/SupportForm/GeneralHelpForm.tsx | 150 +++++++++++++++++- .../SupportForm/SupportFormSchemas.ts | 23 ++- 2 files changed, 170 insertions(+), 3 deletions(-) diff --git a/src/features/SupportForm/GeneralHelpForm.tsx b/src/features/SupportForm/GeneralHelpForm.tsx index 6ac4210..e9a1d52 100644 --- a/src/features/SupportForm/GeneralHelpForm.tsx +++ b/src/features/SupportForm/GeneralHelpForm.tsx @@ -1,6 +1,7 @@ import { zodResolver } from "@hookform/resolvers/zod"; +import { Input, Select, SelectItem, Spacer, Textarea } from "@nextui-org/react"; import { type FC } from "react"; -import { Form, useForm } from "react-hook-form"; +import { Controller, Form, useForm } from "react-hook-form"; import { z } from "zod"; import CommonFields from "./CommonFields"; import SubmitButton from "./SubmitButton"; @@ -9,7 +10,7 @@ import { GeneralHelpFormSchema } from "./SupportFormSchemas"; type GeneralHelpFormProps = {}; const GeneralHelpForm: FC = (props) => { - const { control, register, formState } = useForm< + const { control, register, formState, watch } = useForm< z.infer >({ resolver: zodResolver(GeneralHelpFormSchema), @@ -22,6 +23,151 @@ const GeneralHelpForm: FC = (props) => { register={register} formState={formState} /> + + ( + + )} + /> + + + + + + + + {watch("type") !== "other" && ( + <> + ( + + )} + /> + + + + ( + + )} + /> + + + + )} + +