Adjusted the menu for mobile devices and addressed the webhook issue.
This commit is contained in:
gpt-engineer-app[bot] 2025-06-23 02:39:48 +00:00
parent 763d9a6104
commit a7e5c700ab
3 changed files with 31 additions and 6 deletions

View File

@ -4,7 +4,6 @@ import { ArrowLeft } from 'lucide-react';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { useToast } from '@/hooks/use-toast'; import { useToast } from '@/hooks/use-toast';
import { supabase } from '@/integrations/supabase/client'; import { supabase } from '@/integrations/supabase/client';
import { enviarFaleConoscoParaWebhook } from '@/services/webhookService';
import ContactFormFields from './ContactFormFields'; import ContactFormFields from './ContactFormFields';
import ContactFormHeader from './ContactFormHeader'; import ContactFormHeader from './ContactFormHeader';
@ -92,8 +91,21 @@ const ContactForm = ({ onBack }: ContactFormProps) => {
}; };
try { try {
await enviarFaleConoscoParaWebhook(webhookData); console.log("Enviando dados para webhook N8N:", webhookData);
console.log("Dados enviados para webhook N8N com sucesso");
const response = await fetch('https://webhookn8n.innova1001.com.br/webhook/faleconosco', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(webhookData),
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
console.log("Dados do Fale Conosco enviados com sucesso para o webhook N8N");
} catch (webhookError) { } catch (webhookError) {
console.error("Erro ao enviar para webhook N8N:", webhookError); console.error("Erro ao enviar para webhook N8N:", webhookError);
// Não interrompe o fluxo se o webhook falhar // Não interrompe o fluxo se o webhook falhar

View File

@ -75,6 +75,13 @@ export default function ModernLayout({ children }: ModernLayoutProps) {
closeTour closeTour
} = useOnboardingTour(); } = useOnboardingTour();
// No mobile, o sidebar deve estar fechado por padrão
useEffect(() => {
if (isMobile) {
setOpen(false);
}
}, [isMobile]);
const mainLinks = [ const mainLinks = [
{ {
id: "dashboard", id: "dashboard",

View File

@ -86,7 +86,6 @@ export const DesktopSidebar = ({
}: React.ComponentProps<"div">) => { }: React.ComponentProps<"div">) => {
const { open, setOpen, animate } = useSidebar(); const { open, setOpen, animate } = useSidebar();
// Separate motion-specific props from HTML div props
const { onAnimationStart, onAnimationComplete, ...htmlProps } = props as any; const { onAnimationStart, onAnimationComplete, ...htmlProps } = props as any;
return ( return (
@ -97,7 +96,7 @@ export const DesktopSidebar = ({
className className
)} )}
animate={{ animate={{
width: animate ? (open ? "300px" : "60px") : "300px", width: animate ? (open ? "300px" : "80px") : "300px",
}} }}
onMouseEnter={() => setOpen(true)} onMouseEnter={() => setOpen(true)}
onMouseLeave={() => setOpen(false)} onMouseLeave={() => setOpen(false)}
@ -124,6 +123,11 @@ export const MobileSidebar = ({
{...props} {...props}
> >
<div className="flex items-center space-x-2"> <div className="flex items-center space-x-2">
<img
src="/lovable-uploads/7149adf3-440a-491e-83c2-d964a3348cc9.png"
alt="Finance Home Logo"
className="h-8 w-8 shrink-0"
/>
<span className="text-lg font-semibold text-blue-700">Finance Home</span> <span className="text-lg font-semibold text-blue-700">Finance Home</span>
</div> </div>
<div className="flex justify-end z-20"> <div className="flex justify-end z-20">
@ -153,7 +157,9 @@ export const MobileSidebar = ({
> >
<X className="h-6 w-6" /> <X className="h-6 w-6" />
</div> </div>
<div className="mt-12">
{children} {children}
</div>
</motion.div> </motion.div>
)} )}
</AnimatePresence> </AnimatePresence>