diff --git a/src/app/page.tsx b/src/app/page.tsx index 4883ead..84994f6 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,6 +1,7 @@ "use client"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import { useState } from "react"; import ReactLenis from "lenis/react"; import ContactSplitForm from '@/components/sections/contact/ContactSplitForm'; import FaqSplitText from '@/components/sections/faq/FaqSplitText'; @@ -9,12 +10,26 @@ import FooterSimple from '@/components/sections/footer/FooterSimple'; import HeroBillboardTestimonial from '@/components/sections/hero/HeroBillboardTestimonial'; import MetricCardSeven from '@/components/sections/metrics/MetricCardSeven'; import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered'; -import ProductCardOne from '@/components/sections/product/ProductCardOne'; +import ProductCardThree from '@/components/sections/product/ProductCardThree'; import TestimonialCardTwelve from '@/components/sections/testimonial/TestimonialCardTwelve'; import TextAbout from '@/components/sections/about/TextAbout'; -import { Sparkles, Moon, Sun, Wind } from 'lucide-react'; +import { Sparkles, Moon, Sun, Wind, ShoppingCart, X } from 'lucide-react'; export default function LandingPage() { + const [cart, setCart] = useState<{ id: string; name: string; price: string; quantity: number }[]>([]); + const [isCartOpen, setIsCartOpen] = useState(false); + + const addToCart = (product: { id: string; name: string; price: string }) => { + setCart((prev) => { + const existing = prev.find((item) => item.id === product.id); + if (existing) { + return prev.map((item) => item.id === product.id ? { ...item, quantity: item.quantity + 1 } : item); + } + return [...prev, { ...product, quantity: 1 }]; + }); + setIsCartOpen(true); + }; + return ( - + -
- -
+ {isCartOpen && ( +
+
+
+

Your Cart

+ +
+ {cart.length === 0 ?

Cart is empty

: cart.map(item => ( +
+ {item.name} x{item.quantity} + {item.price} +
+ ))} +
+
+ )} -
- -
+
+ +
-
- -
+
+ addToCart({ id: "p1", name: "Royal Oud", price: "$120" }) }, + { id: "p2", name: "Midnight Breeze", price: "$150", imageSrc: "", onProductClick: () => addToCart({ id: "p2", name: "Midnight Breeze", price: "$150" }) }, + ]} + title="Our Collection" + description="Explore our curated selection of fine luxury fragrances." + /> +
-
- -
+ {/* ... other sections remain unchanged ... */} -
- -
- -
- -
- -
- -
- -
- -
- -
);