From 138375d1719c7efb6e042b4fd453b53255eb4177 Mon Sep 17 00:00:00 2001 From: bender Date: Thu, 28 May 2026 12:03:15 +0000 Subject: [PATCH] Add src/app/cart/page.tsx --- src/app/cart/page.tsx | 87 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 src/app/cart/page.tsx diff --git a/src/app/cart/page.tsx b/src/app/cart/page.tsx new file mode 100644 index 0000000..fa688c2 --- /dev/null +++ b/src/app/cart/page.tsx @@ -0,0 +1,87 @@ +"use client"; + +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import ReactLenis from "lenis/react"; +import ProductCart from '@/components/ecommerce/cart/ProductCart'; +import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen'; +import React, { useState } from 'react'; + +export default function CartPage() { + const [cartItems, setCartItems] = useState([ + { + id: "prod-1", name: "Saffron Elixir Serum", price: "$120.00", quantity: 1, + imageSrc: "http://img.b2bpic.net/free-photo/arrangement-with-make-up-container_23-2149030340.jpg", imageAlt: "Saffron Elixir Serum bottle"}, + { + id: "prod-2", name: "Rose Hydrating Mist", price: "$65.00", quantity: 2, + imageSrc: "http://img.b2bpic.net/free-photo/ecofriendly-beauty-product_23-2150669138.jpg", imageAlt: "Rose Hydrating Mist spray bottle"}, + ]); + + const handleQuantityChange = (id: string, newQuantity: number) => { + setCartItems((prevItems) => + prevItems.map((item) => (item.id === id ? { ...item, quantity: newQuantity } : item)) + ); + }; + + const handleRemoveItem = (id: string) => { + setCartItems((prevItems) => prevItems.filter((item) => item.id !== id)); + }; + + const calculateTotal = () => { + return cartItems + .reduce((sum, item) => sum + parseFloat(item.price.replace('$', '')) * item.quantity, 0) + .toFixed(2); + }; + + const navItems = [ + { name: "Home", id: "/" }, + { name: "Skincare", id: "#skincare" }, + { name: "IranPour Men", id: "#iranpour" }, + { name: "Wholesale", id: "#wholesale" }, + { name: "Contact", id: "#contact" }, + { name: "Cart", id: "/cart" }, + { name: "Checkout", id: "/checkout" }, + ]; + + return ( + + + +
+ {}} // No specific close action for a dedicated page + items={cartItems} + onQuantityChange={handleQuantityChange} + onRemove={handleRemoveItem} + total={`$${calculateTotal()}`} + buttons={[ + { text: "Continue Shopping", href: "/" }, + { text: "Proceed to Checkout", href: "/checkout" }, + ]} + title="Your Shopping Cart" + /> +
+
+
+ ); +}