From a8c8b61a3f2b55d4ee8f6ef9fc3dab98df109e62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=A9o=20GUILBERT?= Date: Tue, 2 Jun 2026 19:08:26 +0200 Subject: [PATCH] move contact modal texts to languages files --- components/ui/ContactFormModal.tsx | 22 ++++++++++++---------- messages/en.json | 12 ++++++++++++ messages/fr.json | 12 ++++++++++++ 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/components/ui/ContactFormModal.tsx b/components/ui/ContactFormModal.tsx index d6b91a7..5d97e82 100644 --- a/components/ui/ContactFormModal.tsx +++ b/components/ui/ContactFormModal.tsx @@ -2,6 +2,7 @@ import { useEffect, useRef, useState, useActionState } from 'react'; import { createPortal } from 'react-dom'; +import { useTranslations } from 'next-intl'; import { sendContactMail, type ContactFormState } from '@/app/actions/sendContactMail'; type Props = { @@ -48,6 +49,7 @@ function Field({ label, name, type = 'text', required, textarea, inputRef }: Fie } export function ContactFormModal({ isOpen, onClose }: Props) { + const t = useTranslations('contactModal'); const [mounted, setMounted] = useState(false); const [state, action, pending] = useActionState( sendContactMail, @@ -96,15 +98,15 @@ export function ContactFormModal({ isOpen, onClose }: Props) {

- Démarrons un projet + {t('title')}

- Je réponds sous 48h. + {t('subtitle')}

) : (
- - + +
- + {state?.error && (

{state.error}

@@ -143,7 +145,7 @@ export function ContactFormModal({ isOpen, onClose }: Props) { disabled={pending} className="inline-flex items-center gap-2.5 font-sans text-[13px] tracking-wide text-brand-beige bg-brand-brown rounded-lg px-7 py-3 hover:bg-brand-brown/85 disabled:opacity-50 transition-colors duration-200 cursor-pointer disabled:cursor-default" > - {pending ? 'Envoi…' : 'Envoyer'} + {pending ? t('sending') : t('send')} {!pending && (