feat(inquires): Make contact form configurable via CMS data
- Add CmsContact type support to FooterForm, Inquires, and InquiresForm components - Make form fields dynamic by accepting contactData prop with configurable Fields array - Add placeholder prop to InputGroup component for enhanced field customization - Replace hardcoded form fields with dynamic field mapping from CMS data - Support dynamic form title and description from contactData - Use CMS-provided submit button text with fallback to default "Submit" - Implement field-level validation configuration including required field handling - Auto-detect input type based on field name (email, phone, text) - Pass contact data from marketing page to FooterForm component - Maintain backward compatibility with default fields when contactData is not provided
This commit is contained in:
@@ -39,6 +39,7 @@ export default async function Home({ params }: IProps) {
|
||||
} catch (error) {
|
||||
console.error("Error fetching CMS data:", error);
|
||||
}
|
||||
console.log(cmsData);
|
||||
|
||||
const centerFrames = [
|
||||
{
|
||||
@@ -247,7 +248,7 @@ export default async function Home({ params }: IProps) {
|
||||
aria-hidden="true"
|
||||
/>
|
||||
|
||||
<FooterForm />
|
||||
<FooterForm contactData={cmsData?.data.contact} />
|
||||
|
||||
<div className="relative z-10 container px-4 py-4 m-auto flex flex-col justify-center items-center mt-80 ">
|
||||
<div className="flex justify-between flex-col lg:flex-row gap-14 w-full lg:w-1/2">
|
||||
|
||||
Reference in New Issue
Block a user