Implement CiviCRM middleware form with stage-based visibility
- Initialize Next.js project with Tailwind CSS - Create CiviCRM APIv4 integration layer - Implement stage-based form visibility (stages 0-5) - Add field mapping configuration for CRM-to-form linking - Create API routes for data retrieval and submission - Record form submissions as CiviCRM activities - Support dynamic contactId and orgId via URL parameters - Ensure robust form state management with react-hook-form Co-authored-by: joelbrock <52835+joelbrock@users.noreply.github.com>
This commit is contained in:
23
app/page.tsx
Normal file
23
app/page.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
'use client';
|
||||
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
import StageForm from '@/components/StageForm';
|
||||
import { Suspense } from 'react';
|
||||
|
||||
function FormContainer() {
|
||||
const searchParams = useSearchParams();
|
||||
const contactId = searchParams.get('contactId') || '2';
|
||||
const orgId = searchParams.get('orgId') || '1';
|
||||
|
||||
return <StageForm contactId={contactId} orgId={orgId} />;
|
||||
}
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<main className="min-h-screen bg-gray-100 py-12">
|
||||
<Suspense fallback={<div className="text-center">Loading...</div>}>
|
||||
<FormContainer />
|
||||
</Suspense>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user