Add src/app/specials/page.tsx
This commit is contained in:
186
src/app/specials/page.tsx
Normal file
186
src/app/specials/page.tsx
Normal file
@@ -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<CartItem[]>([]);
|
||||
|
||||
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 (
|
||||
<ThemeProvider
|
||||
defaultButtonVariant="elastic-effect"
|
||||
defaultTextAnimation="background-highlight"
|
||||
borderRadius="pill"
|
||||
contentWidth="mediumLarge"
|
||||
sizing="largeSmallSizeMediumTitles"
|
||||
background="grid"
|
||||
cardStyle="layered-gradient"
|
||||
primaryButtonStyle="primary-glow"
|
||||
secondaryButtonStyle="layered"
|
||||
headingFontWeight="bold"
|
||||
>
|
||||
<div id="nav" data-section="nav">
|
||||
<NavbarLayoutFloatingInline
|
||||
brandName="Super Liquor Paihia"
|
||||
navItems={[
|
||||
{ name: "Home", id: "/" },
|
||||
{ name: "Specials", id: "/specials" },
|
||||
{ name: "Selection", id: "selection" },
|
||||
{ name: "Contact", id: "contact" },
|
||||
]}
|
||||
button={{
|
||||
text: "Call Now", href: "tel:0994558333"
|
||||
}}
|
||||
animateOnLoad={true}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div id="specials" data-section="specials">
|
||||
<ProductCardThree
|
||||
title="Weekly Specials & Deals"
|
||||
description="Explore our latest promotions and exclusive in-store offers. Add items to cart and checkout with ease."
|
||||
tag="Limited Time Offers"
|
||||
tagIcon={Zap}
|
||||
tagAnimation="slide-up"
|
||||
products={[
|
||||
{
|
||||
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", onProductClick: () => 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) },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<ProductCart
|
||||
isOpen={cartOpen}
|
||||
onClose={() => 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"
|
||||
/>
|
||||
|
||||
<div id="contact" data-section="contact">
|
||||
<ContactCTA
|
||||
tag="Ready to Order?"
|
||||
tagIcon={Phone}
|
||||
tagAnimation="slide-up"
|
||||
title="Call to Complete Your Order"
|
||||
description="For immediate assistance with your purchase or to place a custom order, call us directly. Our team is ready to help you get exactly what you need."
|
||||
buttons={[
|
||||
{ text: "Call 09 945 8333", href: "tel:0994558333" },
|
||||
{ text: "Get Directions", href: "https://maps.google.com/?q=14+Marsden+Road+Paihia+0200+New+Zealand" },
|
||||
]}
|
||||
buttonAnimation="slide-up"
|
||||
background={{ variant: "animated-grid" }}
|
||||
useInvertedBackground={false}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div id="footer" data-section="footer">
|
||||
<FooterCard
|
||||
logoText="Super Liquor Paihia"
|
||||
copyrightText="© 2025 Super Liquor Paihia | 14 Marsden Road, Paihia 0200 | Ph: 09 945 8333"
|
||||
socialLinks={[
|
||||
{
|
||||
icon: Phone,
|
||||
href: "tel:0994558333", ariaLabel: "Call us"
|
||||
},
|
||||
{
|
||||
icon: MapPin,
|
||||
href: "https://maps.google.com/?q=14+Marsden+Road+Paihia+0200+New+Zealand", ariaLabel: "Get directions"
|
||||
},
|
||||
{
|
||||
icon: Mail,
|
||||
href: "mailto:info@superliquorpaihia.co.nz", ariaLabel: "Send email"
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user