Add titles to form data and display them dynamically

Incorporated 'title' property into form data objects for dynamic rendering in the GenericForm component. This enhancement facilitates the use of specific titles for different forms, improving readability and user experience.
This commit is contained in:
Teriuihi 2024-08-07 00:41:11 +02:00
parent f52201b683
commit 973b6b5e7d
4 changed files with 6 additions and 3 deletions

View File

@ -202,5 +202,6 @@ export const apply: FormData = {
other: Yup.string()
.max(2000, 'Please provide at most 2000 characters')
})
}),
title: "Staff Application"
};

View File

@ -47,5 +47,6 @@ export const contact: FormData = {
.min(10, 'Question should be at least 10 characters')
.max(2000, 'Question should not exceed 2000 characters')
.required('Question is required')
})
}),
title: "Contact Form"
};

View File

@ -22,6 +22,7 @@ export type FormData = {
backend: string;
userInput: UserInput;
spec: Yup.Schema<any>
title: string;
}
export interface FormProperties {

View File

@ -60,7 +60,7 @@ const GenericForm = (formData: FormData) => {
return (
<div className="container">
<div>
<h1>Contact Form</h1>
<h1>{formData.title}</h1>
</div>
<div>
<Formik