From 38d81a2a6e3a911d89369005dbde5fb4f5d2908b Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Thu, 29 Jan 2026 22:02:37 +0000 Subject: [PATCH] Changes --- src/components/CartDrawer.tsx | 41 ++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/src/components/CartDrawer.tsx b/src/components/CartDrawer.tsx index f6b002f..9818040 100644 --- a/src/components/CartDrawer.tsx +++ b/src/components/CartDrawer.tsx @@ -1,5 +1,6 @@ import { useState, useEffect } from 'react'; import { X, Minus, Plus, Trash2, Send, MessageSquare } from 'lucide-react'; +import { useNavigate } from 'react-router-dom'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Textarea } from '@/components/ui/textarea'; @@ -16,14 +17,9 @@ import { useCart } from '@/context/CartContext'; import { useToast } from '@/hooks/use-toast'; export function CartDrawer() { - // Listen for custom event from mobile nav - useEffect(() => { - const handleOpenCart = () => setIsCartOpen(true); - window.addEventListener('open-cart', handleOpenCart); - return () => window.removeEventListener('open-cart', handleOpenCart); - }, []); const { items, isCartOpen, setIsCartOpen, removeItem, updateQuantity, updateNotes, clearCart } = useCart(); const { toast } = useToast(); + const navigate = useNavigate(); const [quoteMessage, setQuoteMessage] = useState(''); const [isSubmitting, setIsSubmitting] = useState(false); const [showQuoteForm, setShowQuoteForm] = useState(false); @@ -34,6 +30,18 @@ export function CartDrawer() { company: '', }); + // Listen for custom event from mobile nav + useEffect(() => { + const handleOpenCart = () => setIsCartOpen(true); + window.addEventListener('open-cart', handleOpenCart); + return () => window.removeEventListener('open-cart', handleOpenCart); + }, [setIsCartOpen]); + + const goTo = (to: string) => { + setIsCartOpen(false); + navigate(to); + }; + const handleRequestQuote = () => { if (items.length === 0) { toast({ @@ -106,10 +114,23 @@ export function CartDrawer() { - Quote Request Cart -

- Add items and request a personalized quote -

+
+
+ Quote Request Cart +

+ Add items and request a personalized quote +

+
+ + +
+ +
+ + +
{items.length === 0 ? (