From 23e0d0e136b8b096edbc9f8c95fc19c533cf1c66 Mon Sep 17 00:00:00 2001 From: bender Date: Mon, 9 Mar 2026 21:15:42 +0000 Subject: [PATCH] Add src/app/specials/page.tsx --- src/app/specials/page.tsx | 186 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 src/app/specials/page.tsx diff --git a/src/app/specials/page.tsx b/src/app/specials/page.tsx new file mode 100644 index 0000000..454314f --- /dev/null +++ b/src/app/specials/page.tsx @@ -0,0 +1,186 @@ +"use client"; + +import { useState } from 'react'; +import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline'; +import ProductCardThree from '@/components/sections/product/ProductCardThree'; +import ContactCTA from '@/components/sections/contact/ContactCTA'; +import FooterCard from '@/components/sections/footer/FooterCard'; +import ProductCart from '@/components/ecommerce/cart/ProductCart'; +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import { Mail, MapPin, Phone, ShoppingCart, Zap } from 'lucide-react'; + +interface CartItem { + id: string; + name: string; + price: string; + quantity: number; + imageSrc: string; + imageAlt?: string; +} + +export default function SpecialsPage() { + const [cartOpen, setCartOpen] = useState(false); + const [cartItems, setCartItems] = useState([]); + + const handleAddToCart = (product: { id: string; name: string; price: string; imageSrc: string; imageAlt?: string }, quantity: number) => { + const existingItem = cartItems.find(item => item.id === product.id); + if (existingItem) { + setCartItems(cartItems.map(item => + item.id === product.id + ? { ...item, quantity: item.quantity + quantity } + : item + )); + } else { + setCartItems([...cartItems, { ...product, quantity }]); + } + }; + + const handleQuantityChange = (id: string, quantity: number) => { + if (quantity > 0) { + setCartItems(cartItems.map(item => + item.id === id ? { ...item, quantity } : item + )); + } + }; + + const handleRemoveItem = (id: string) => { + setCartItems(cartItems.filter(item => item.id !== id)); + }; + + const total = cartItems.reduce((sum, item) => { + const price = parseFloat(item.price.replace('$', '').replace(/,/g, '')); + return sum + (price * item.quantity); + }, 0).toFixed(2); + + return ( + + + +
+ console.log('Beer pack clicked'), + onQuantityChange: (qty) => handleAddToCart({ id: "1", name: "Craft Beer Pack - 6 Pack", price: "$23.99", imageSrc: "http://img.b2bpic.net/free-photo/top-view-beer-bottles-with-chips_23-2148673798.jpg", imageAlt: "Craft beer 6-pack special" }, qty), + initialQuantity: 1 + }, + { + id: "2", name: "Premium Red Wine Selection", price: "$34.99", imageSrc: "http://img.b2bpic.net/free-photo/tray-with-wine-bottle-stoppers-beside_23-2148414202.jpg", imageAlt: "Premium wine promotion", onProductClick: () => console.log('Wine clicked'), + onQuantityChange: (qty) => handleAddToCart({ id: "2", name: "Premium Red Wine Selection", price: "$34.99", imageSrc: "http://img.b2bpic.net/free-photo/tray-with-wine-bottle-stoppers-beside_23-2148414202.jpg", imageAlt: "Premium wine promotion" }, qty), + initialQuantity: 1 + }, + { + id: "3", name: "Whisky Collection Bundle", price: "$89.99", imageSrc: "http://img.b2bpic.net/free-photo/front-view-tasty-american-beer-assortment_23-2148907595.jpg", imageAlt: "Whisky bundle special", onProductClick: () => console.log('Whisky clicked'), + onQuantityChange: (qty) => handleAddToCart({ id: "3", name: "Whisky Collection Bundle", price: "$89.99", imageSrc: "http://img.b2bpic.net/free-photo/front-view-tasty-american-beer-assortment_23-2148907595.jpg", imageAlt: "Whisky bundle special" }, qty), + initialQuantity: 1 + }, + { + id: "4", name: "Vodka Premium Brands", price: "$44.99", imageSrc: "http://img.b2bpic.net/free-photo/top-view-beer-bottles-with-chips_23-2148673798.jpg", imageAlt: "Premium vodka selection", onProductClick: () => console.log('Vodka clicked'), + onQuantityChange: (qty) => handleAddToCart({ id: "4", name: "Vodka Premium Brands", price: "$44.99", imageSrc: "http://img.b2bpic.net/free-photo/top-view-beer-bottles-with-chips_23-2148673798.jpg", imageAlt: "Premium vodka selection" }, qty), + initialQuantity: 1 + }, + { + id: "5", name: "Local Brewery Selection", price: "$28.99", imageSrc: "http://img.b2bpic.net/free-photo/tray-with-wine-bottle-stoppers-beside_23-2148414202.jpg", imageAlt: "Local brewery pack", onProductClick: () => console.log('Local brewery clicked'), + onQuantityChange: (qty) => handleAddToCart({ id: "5", name: "Local Brewery Selection", price: "$28.99", imageSrc: "http://img.b2bpic.net/free-photo/tray-with-wine-bottle-stoppers-beside_23-2148414202.jpg", imageAlt: "Local brewery pack" }, qty), + initialQuantity: 1 + }, + { + id: "6", name: "Gin & Tonic Bundle", price: "$52.99", imageSrc: "http://img.b2bpic.net/free-photo/front-view-tasty-american-beer-assortment_23-2148907595.jpg", imageAlt: "Gin and tonic bundle", onProductClick: () => console.log('Gin bundle clicked'), + onQuantityChange: (qty) => handleAddToCart({ id: "6", name: "Gin & Tonic Bundle", price: "$52.99", imageSrc: "http://img.b2bpic.net/free-photo/front-view-tasty-american-beer-assortment_23-2148907595.jpg", imageAlt: "Gin and tonic bundle" }, qty), + initialQuantity: 1 + }, + ]} + gridVariant="three-columns-all-equal-width" + animationType="slide-up" + textboxLayout="default" + useInvertedBackground={false} + buttons={[ + { text: "View Cart", onClick: () => setCartOpen(true) }, + ]} + /> +
+ + setCartOpen(false)} + items={cartItems} + onQuantityChange={handleQuantityChange} + onRemove={handleRemoveItem} + total={`$${total}`} + buttons={[ + { text: "Checkout", onClick: () => { setCartOpen(false); alert('Checkout functionality coming soon!'); } }, + { text: "Continue Shopping", onClick: () => setCartOpen(false) } + ]} + title="Shopping Cart" + /> + +
+ +
+ + +
+ ); +}