Files
AndreaSlopFotografie/web/src/components/ContactForm/ContactFormGate.tsx
T
SluijsensandClaude Opus 5.5 26a8bd9469 Shares the contact form, contact card and privacy line
ContactPanel holds the coming-soon gate, the shoot options, the package
chosen via ?pakket= and the form, which loads as its own chunk either
when it comes near the screen (homepage) or right away (contact page).
ContactDetails shows the ways to reach Andrea as a card with icons. A
privacy line now sits under the form and under the coming-soon notice,
and the reply time in the thank-you comes from the site content.
Instagram is listed before Facebook, so the footer and hero follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:26:48 +01:00

78 lines
2.7 KiB
TypeScript

import type { ReactNode } from 'react';
import { Box, chakra, Link, Text, useRecipe } from '@chakra-ui/react';
import Eyebrow from '@/components/Eyebrow/Eyebrow';
import PrivacyNote from '@/components/PrivacyNote/PrivacyNote';
import type { EmailAddress } from '@/content/types';
import { emailAddress } from '@/lib/emailAddress';
import { mailtoLink } from '@/lib/mailLink';
type ContactFormGateProps = {
enabled: boolean;
email: EmailAddress;
subject: string;
children: ReactNode;
};
// Until there is a back-end the form stays visible but dimmed and inert
// under a "coming soon" notice with a mail button (FR-HP-07). inert keeps
// keyboard and screen reader users out of a form that does nothing.
export default function ContactFormGate({
enabled,
email,
subject,
children,
}: ContactFormGateProps) {
const linkButton = useRecipe({ key: 'linkButton' });
if (enabled) return <>{children}</>;
// Assembled in the browser, so the address is nowhere in the bundle
const address = emailAddress(email);
const href = address ? mailtoLink(address, subject) : undefined;
return (
<Box position="relative" data-testid="contact-gate">
<Box inert opacity={0.35} filter="blur(1.5px)" userSelect="none">
{children}
</Box>
<Box
position="absolute"
top="50%"
left="50%"
transform="translate(-50%, -50%)"
w="min(100%, 520px)"
p="clamp(2rem, 4vw, 3rem)"
bg="white"
borderWidth="1px"
borderColor="line"
boxShadow="panel"
textAlign="center"
data-testid="contact-gate-notice"
>
<Eyebrow>Binnenkort</Eyebrow>
<Text color="ink.soft" mb={address ? 7 : 0}>
Het contactformulier komt binnenkort.
{address && (
<>
{' Mail me voor nu op '}
<Link variant="underline" href={href}>
{address}
</Link>
</>
)}
</Text>
{address && (
<chakra.a
href={href}
css={linkButton({ variant: 'accent' })}
data-testid="contact-gate-mail"
>
Stuur een e-mail
</chakra.a>
)}
{/* Readable now, while the form's own line is inert (BR-PR-03) */}
<PrivacyNote mt={6} />
</Box>
</Box>
);
}