fix: contact form sends to API, remove dead links, secure .env
- Contact form now POSTs to /rpc/contact (www-api → n8n webhook) - Footer links: Mon compte → store.targo.ca, placeholder # → /support - .env added to .gitignore (Supabase keys should not be committed) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
88dc3714a1
commit
0af24643ff
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -22,3 +22,4 @@ dist-ssr
|
||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
.env
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ La fiabilité, la performance et l'expertise à proximité pour propulser vos co
|
||||||
<ul className="space-y-3 text-sm text-white/60">
|
<ul className="space-y-3 text-sm text-white/60">
|
||||||
<li><a href="#apropos" className="hover:text-targo-green transition-colors">À propos</a></li>
|
<li><a href="#apropos" className="hover:text-targo-green transition-colors">À propos</a></li>
|
||||||
<li><a href="#contact" className="hover:text-targo-green transition-colors">Contact</a></li>
|
<li><a href="#contact" className="hover:text-targo-green transition-colors">Contact</a></li>
|
||||||
<li><a href="#" className="hover:text-targo-green transition-colors">Mon compte</a></li>
|
<li><a href="https://store.targo.ca/clients" className="hover:text-targo-green transition-colors">Mon compte</a></li>
|
||||||
<li><a href="#" className="hover:text-targo-green transition-colors">Politique de confidentialité</a></li>
|
<li><a href="/support" className="hover:text-targo-green transition-colors">Politique de confidentialité</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -79,8 +79,8 @@ La fiabilité, la performance et l'expertise à proximité pour propulser vos co
|
||||||
© {new Date().getFullYear()} TARGO Communications. Tous droits réservés.
|
© {new Date().getFullYear()} TARGO Communications. Tous droits réservés.
|
||||||
</p>
|
</p>
|
||||||
<div className="flex items-center gap-8 text-xs font-semibold uppercase tracking-wider text-white/40">
|
<div className="flex items-center gap-8 text-xs font-semibold uppercase tracking-wider text-white/40">
|
||||||
<a href="#" className="hover:text-targo-green transition-all">Plan d'accessibilité</a>
|
<a href="/support" className="hover:text-targo-green transition-all">Plan d'accessibilité</a>
|
||||||
<a href="#" className="hover:text-targo-green transition-all">Conditions d'utilisation</a>
|
<a href="/support" className="hover:text-targo-green transition-all">Conditions d'utilisation</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -42,20 +42,26 @@ const Contact = () => {
|
||||||
message: "",
|
message: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (e: React.FormEvent) => {
|
const [sending, setSending] = useState(false);
|
||||||
|
|
||||||
|
const handleSubmit = async (e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
toast({
|
setSending(true);
|
||||||
title: "Message envoyé!",
|
try {
|
||||||
description: "Nous vous répondrons dans les plus brefs délais.",
|
await fetch('/rpc/contact', {
|
||||||
});
|
method: 'POST',
|
||||||
setFormData({
|
headers: { 'Content-Type': 'application/json' },
|
||||||
name: "",
|
body: JSON.stringify(formData),
|
||||||
address: "",
|
});
|
||||||
postalCode: "",
|
toast({
|
||||||
email: "",
|
title: "Message envoyé!",
|
||||||
phone: "",
|
description: "Nous vous répondrons dans les plus brefs délais.",
|
||||||
message: "",
|
});
|
||||||
});
|
setFormData({ name: "", address: "", postalCode: "", email: "", phone: "", message: "" });
|
||||||
|
} catch {
|
||||||
|
toast({ title: "Erreur", description: "Impossible d'envoyer. Réessayez ou appelez-nous.", variant: "destructive" });
|
||||||
|
}
|
||||||
|
setSending(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user