Client
Frontend Patterns
React component structure for public broker landing pages, admin management UI, routing configuration, and navigation integration.
Public Broker Landing Page
Route: /broker/:slug. This page is publicly accessible and serves as the broker's branded entry point.
Key Sections
Hero
Gradient background using brandColor, headline, subheadline, CTA button
Bio
Broker photo, name, company, contact details
Services
Grid of service cards (from JSON field)
Testimonials
Client testimonials (from JSON field)
Trust Indicators
"Why Choose Us" section with icons
Footer CTA
Second call-to-action with application link
CTA links should include the broker slug: /apply?broker={slug}
// Route: /broker/:slug
export default function BrokerLandingPage() {
const params = useParams<{ slug: string }>();
const { data: page, isLoading } = trpc.brokerLanding.getBySlug.useQuery(
{ slug: params.slug! },
{ enabled: !!params.slug }
);
if (isLoading) return <LoadingSkeleton />;
if (!page) return <NotFoundPage />;
const brandColor = page.brandColor || "#1e3a5f";
// Render hero, bio, services, testimonials, CTA sections
}Admin Landing Pages Management
Route: /admin/landing-pages. Admin-only page for managing all broker landing pages.
Features
export default function AdminLandingPages() {
const { data: pages } = trpc.brokerLanding.listAll.useQuery();
const utils = trpc.useUtils();
const createMut = trpc.brokerLanding.create.useMutation({
onSuccess: () => utils.brokerLanding.listAll.invalidate(),
});
const updateMut = trpc.brokerLanding.adminUpdate.useMutation({
onSuccess: () => utils.brokerLanding.listAll.invalidate(),
});
const deleteMut = trpc.brokerLanding.delete.useMutation({
onSuccess: () => utils.brokerLanding.listAll.invalidate(),
});
// ... render table, dialogs, actions
}Routing
Add these routes to App.tsx:
<Route path="/broker/:slug" component={BrokerLandingPage} />
<Route path="/admin/landing-pages" component={AdminLandingPages} />Navigation
Add the landing pages link to the admin navigation or dropdown menu:
{ label: "Landing Pages", href: "/admin/landing-pages", icon: Globe }