From 654bdd25212095b6c9562acfe3b9b98729e85b25 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 3 Dec 2025 20:08:10 -0300 Subject: [PATCH] fix: corrigir WhatsApp button com URL api.whatsapp.com e remover glitch do hover --- frontend/src/components/WhatsAppButton.tsx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/WhatsAppButton.tsx b/frontend/src/components/WhatsAppButton.tsx index d07082b..db7304b 100644 --- a/frontend/src/components/WhatsAppButton.tsx +++ b/frontend/src/components/WhatsAppButton.tsx @@ -6,7 +6,7 @@ import { useState, useEffect } from 'react'; export default function WhatsAppButton() { const { t } = useLanguage(); - const [whatsappLink, setWhatsappLink] = useState('https://wa.me/5513998030036'); + const [whatsappLink, setWhatsappLink] = useState('https://api.whatsapp.com/send/?phone=5513998030036&text&type=phone_number&app_absent=0'); const [mounted, setMounted] = useState(false); useEffect(() => { @@ -18,7 +18,7 @@ export default function WhatsAppButton() { .then(data => { if (data.whatsapp) { const cleanNumber = data.whatsapp.replace(/\D/g, ''); - setWhatsappLink(`https://wa.me/${cleanNumber}`); + setWhatsappLink(`https://api.whatsapp.com/send/?phone=${cleanNumber}&text&type=phone_number&app_absent=0`); } }) .catch(console.error); @@ -33,13 +33,21 @@ export default function WhatsAppButton() { href={whatsappLink} target="_blank" rel="noopener noreferrer" - className="fixed bottom-6 right-6 z-40 flex flex-row-reverse items-center justify-center bg-[#25D366] text-white w-14 h-14 rounded-full shadow-lg hover:bg-[#20bd5a] transition-all duration-300 group" + className="fixed bottom-6 right-6 z-40 bg-[#25D366] text-white w-14 h-14 rounded-full shadow-lg hover:shadow-xl transition-shadow duration-200 flex items-center justify-center flex-shrink-0" aria-label={t('whatsapp.label')} + style={{ + transition: 'all 0.2s ease-in-out', + }} + onMouseEnter={(e) => { + e.currentTarget.style.backgroundColor = '#20bd5a'; + e.currentTarget.style.transform = 'scale(1.1)'; + }} + onMouseLeave={(e) => { + e.currentTarget.style.backgroundColor = '#25D366'; + e.currentTarget.style.transform = 'scale(1)'; + }} > - - - {t('whatsapp.label')} - + ); }