From 401e495c8d657f16e95a65574981679c6c96b95d Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 17 Apr 2026 05:24:09 +0000 Subject: [PATCH] Update src/app/page.tsx --- src/app/page.tsx | 235 ++++++++++++++++++++++------------------------- 1 file changed, 109 insertions(+), 126 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index ca5f54f..0403f63 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,5 +1,6 @@ "use client"; +import { useState } from "react"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import ReactLenis from "lenis/react"; import FeatureCardTwentyFour from '@/components/sections/feature/FeatureCardTwentyFour'; @@ -11,6 +12,14 @@ import ProductCardThree from '@/components/sections/product/ProductCardThree'; import TestimonialCardOne from '@/components/sections/testimonial/TestimonialCardOne'; export default function LandingPage() { + const [cart, setCart] = useState([]); + const [isCartOpen, setIsCartOpen] = useState(false); + + const addToCart = (product: any) => { + setCart((prev) => [...prev, product]); + setIsCartOpen(true); + }; + return ( - + -
- -
+ {isCartOpen && ( +
+
+

Your Cart

+ {cart.length === 0 ?

Cart is empty

: cart.map((item, i) =>
{item.name} - {item.price}
)} + +
+
+ )} -
- -
+
+ +
-
- -
+
+ +
-
- -
+
+ addToCart({ name: "Roasted Macadamias", price: "$15.00" }) }, + { id: "p2", name: "Artisan Truffles", price: "$22.00", imageSrc: "http://img.b2bpic.net/free-photo/slice-chocolate-cake-white-plate-with-fruit-crackers_114579-19106.jpg", onProductClick: () => addToCart({ name: "Artisan Truffles", price: "$22.00" }) }, + { id: "p3", name: "Salted Pistachios", price: "$18.00", imageSrc: "http://img.b2bpic.net/free-photo/many-types-nuts-with-space-left_23-2147690256.jpg", onProductClick: () => addToCart({ name: "Salted Pistachios", price: "$18.00" }) }, + { id: "p4", name: "Almond Brittle", price: "$12.00", imageSrc: "http://img.b2bpic.net/free-photo/nougats-plate-still-life-top-view_23-2149646310.jpg", onProductClick: () => addToCart({ name: "Almond Brittle", price: "$12.00" }) }, + { id: "p5", name: "Walnut Medley", price: "$16.00", imageSrc: "http://img.b2bpic.net/free-photo/top-view-mixture-tasty-nuts_23-2148405863.jpg", onProductClick: () => addToCart({ name: "Walnut Medley", price: "$16.00" }) }, + { id: "p6", name: "Dark Chocolate Delights", price: "$20.00", imageSrc: "http://img.b2bpic.net/free-photo/top-view-golden-cupcakes-wooden-board_23-2148579267.jpg", onProductClick: () => addToCart({ name: "Dark Chocolate Delights", price: "$20.00" }) }, + ]} + title="Signature Collection" + description="Experience our most loved savory nuts and sweet treats." + /> +
-
- -
+
+ +
- +
+ +
+ +
); -- 2.49.1