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:
@@ -1,17 +1,20 @@
|
||||
import { CmsContact } from "@/types/TCms";
|
||||
import InquiresForm from "./form";
|
||||
|
||||
const Inquires = () => {
|
||||
const Inquires = ({ contactData }: { contactData?: CmsContact }) => {
|
||||
return (
|
||||
<div className="flex flex-col items-center mt-16 px-8 ">
|
||||
<div className="lg:w-2/3 m-auto flex flex-col gap-4 mb-12">
|
||||
<h2 className="font-bold text-4xl">Unlock Your Growth Potential</h2>
|
||||
<h2 className="font-bold text-4xl">
|
||||
{contactData?.Title || "Unlock Your Growth Potential"}
|
||||
</h2>
|
||||
<p className="font-normal text-[16px] text-gray-600">
|
||||
Register for early access and a free consultation. Let's start winning
|
||||
together.
|
||||
{contactData?.Description ||
|
||||
"Register for early access and a free consultation. Let's start winning together."}
|
||||
</p>
|
||||
</div>
|
||||
<section className="border border-gray-300 rounded-4xl w-full lg:max-w-2/3 flex flex-col items-center bg-white">
|
||||
<InquiresForm />
|
||||
<InquiresForm contactData={contactData} />
|
||||
</section>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user