From 79ae7251c9106f5973884cc6a159fdaf9a5bfcf6 Mon Sep 17 00:00:00 2001 From: 230419 <230419@epvc.pt> Date: Wed, 29 Apr 2026 01:25:32 +0100 Subject: [PATCH] feedback! --- src/App.jsx | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 5628184..e762488 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1525,15 +1525,40 @@ export default function App() {

{t('feedbackTitle') || 'Suporte e Feedback'}

{t('feedbackDesc') || 'Tem alguma ideia, sugestão ou encontrou algum problema? Envie uma mensagem diretamente para nós!'}

-
{ + { e.preventDefault(); const fd = new FormData(e.target); const type = fd.get('type'); const msg = fd.get('message'); - // Substitua pelo seu email real const email = "faiker027@gmail.com"; - window.location.href = `mailto:${email}?subject=${encodeURIComponent(`MyCloset Feedback: ${type}`)}&body=${encodeURIComponent(msg)}`; - e.target.reset(); + + try { + const response = await fetch(`https://formsubmit.co/ajax/${email}`, { + method: "POST", + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }, + body: JSON.stringify({ + Tipo: type, + Mensagem: msg, + Utilizador: user?.email || 'Desconhecido', + _subject: `MyCloset Feedback: ${type}` + }) + }); + + if (response.ok) { + setToastMessage('Mensagem enviada com sucesso!'); + setTimeout(() => setToastMessage(null), 4000); + e.target.reset(); + } else { + throw new Error('Falha no envio'); + } + } catch (error) { + console.error("Erro ao enviar feedback:", error); + setToastMessage('Erro ao enviar mensagem. Verifica a tua ligação.'); + setTimeout(() => setToastMessage(null), 4000); + } }} className="space-y-4">