|
1 | 1 | "use client" |
2 | 2 |
|
3 | 3 | import { ContactForm } from "@/components/forms/ContactForm" |
| 4 | +import { useDesktopPinnedPosition } from "@/hooks/useDesktopPinnedPosition" |
4 | 5 | import type { ContactLayoutBlock } from "@/lib/cms" |
5 | 6 | import type { AppLocale } from "@/lib/i18n" |
6 | | -import { useDesktopPinnedPosition } from "@/hooks/useDesktopPinnedPosition" |
7 | 7 |
|
8 | | -interface ContactPageContentProps { |
| 8 | +interface ContactSectionProps { |
9 | 9 | locale: AppLocale |
10 | | - contactBlock: ContactLayoutBlock | null |
| 10 | + content?: ContactLayoutBlock | null |
11 | 11 | } |
12 | 12 |
|
13 | | -export function ContactPageContent({ locale, contactBlock }: ContactPageContentProps) { |
| 13 | +export function ContactSection({ locale, content }: ContactSectionProps) { |
14 | 14 | const desktopTopOffset = 128 |
15 | | - const pageHeading = contactBlock?.heading ?? "Contact us" |
16 | | - const pageDescription = contactBlock?.description ?? "Contact us if you want to know more about CodeZero." |
| 15 | + const pageHeading = content?.heading ?? "Contact us" |
| 16 | + const pageDescription = content?.description ?? "Contact us if you want to know more about CodeZero." |
17 | 17 |
|
18 | 18 | const { wrapperRef: desktopWrapperRef, containerRef: desktopContainerRef } = useDesktopPinnedPosition<HTMLElement, HTMLDivElement>(desktopTopOffset) |
19 | 19 |
|
20 | 20 | return ( |
21 | | - <div className="grid gap-8 lg:grid-cols-2"> |
| 21 | + <div className="mx-auto grid w-full max-w-5xl gap-8 lg:grid-cols-2"> |
22 | 22 | <section className="min-w-0"> |
23 | 23 | <h1 className="text-4xl font-semibold text-white">{pageHeading}</h1> |
24 | 24 | <p className="mt-4 text-secondary">{pageDescription}</p> |
25 | 25 | </section> |
26 | 26 |
|
27 | 27 | <section ref={desktopWrapperRef} className="relative min-w-0"> |
28 | | - <div |
29 | | - ref={desktopContainerRef} |
30 | | - className="relative z-10" |
31 | | - > |
32 | | - <ContactForm content={contactBlock} locale={locale} /> |
| 28 | + <div ref={desktopContainerRef} className="relative z-10"> |
| 29 | + <ContactForm content={content} locale={locale} /> |
33 | 30 | </div> |
34 | 31 | </section> |
35 | 32 | </div> |
|
0 commit comments