This pull request improves the functionality and reusability of the form components in the vets-who-code-app repository. It adds a reset function to the useForm hook and the ApplyForm component to clear the form fields after submission or cancellation. It also refactors the ContactForm and the MentorForm components to use the generic ApplyForm component and moves them to separate files.
To improve the user interfaceWe refactored some form componentsWe moved ContactForm to its placeAnd used useForm's resetTo clear ApplyForm in any case
Walkthrough
Refactored the different forms into one reusable component ApplyForm that can handle different scenarios based on props (link, link)
Added the reset function from the useForm hook to the ApplyForm, ContactForm, and MentorForm components to clear the form fields after a successful submission or a cancellation (link, link)
Called the reset function inside the onSubmit handler of the ApplyForm, ContactForm, and MentorForm components (link, link, link)
Removed some of the form fields that are not relevant for the mentor application from the MentorForm component, such as branch of service, technical expertise, GitHub portfolio or LinkedIn, location, and employer restrictions (link)
Removed the unnecessary comment that indicates the file name of the ContactForm component from src/components/forms/contact-form.tsx (link)
🤖 Generated by Copilot at 6102478
Summary
🔄♻️📝
This pull request improves the functionality and reusability of the form components in the
vets-who-code-app
repository. It adds areset
function to theuseForm
hook and theApplyForm
component to clear the form fields after submission or cancellation. It also refactors theContactForm
and theMentorForm
components to use the genericApplyForm
component and moves them to separate files.Walkthrough
ApplyForm
that can handle different scenarios based on props (link, link)reset
function from theuseForm
hook to theApplyForm
,ContactForm
, andMentorForm
components to clear the form fields after a successful submission or a cancellation (link, link)reset
function inside theonSubmit
handler of theApplyForm
,ContactForm
, andMentorForm
components (link, link, link)MentorForm
component, such as branch of service, technical expertise, GitHub portfolio or LinkedIn, location, and employer restrictions (link)ContactForm
component fromsrc/components/forms/contact-form.tsx
(link)