From d1b0b0fd7bfd9eb416e9b3c76d973622379c9d01 Mon Sep 17 00:00:00 2001 From: notshop Date: Sun, 26 Apr 2026 16:36:08 +0000 Subject: [PATCH] chore: add client/src/pages/cart.tsx --- client/src/pages/cart.tsx | 82 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 client/src/pages/cart.tsx diff --git a/client/src/pages/cart.tsx b/client/src/pages/cart.tsx new file mode 100644 index 0000000..e59a171 --- /dev/null +++ b/client/src/pages/cart.tsx @@ -0,0 +1,82 @@ +import { Link } from "wouter"; +import { ShoppingBag, Trash2 } from "lucide-react"; +import { useCart } from "../hooks/use-cart"; + +export default function CartPage() { + const { items, updateQuantity, removeItem, subtotal } = useCart(); + + if (items.length === 0) { + return ( +
+ +

Your cart is empty

+ + Browse products + +
+ ); + } + + return ( +
+

Shopping cart ({items.length})

+
+
+ {items.map((item) => ( +
+ {item.imageUrl && ( + {item.title} + )} +
+ + {item.title} + + {item.variantTitle && item.variantTitle !== "Default Title" && ( +

{item.variantTitle}

+ )} +

${parseFloat(item.price).toFixed(2)}

+
+
+ +
+ + {item.quantity} + +
+ ${(parseFloat(item.price) * item.quantity).toFixed(2)} +
+
+ ))} +
+ +
+
+

Order summary

+
+
+ Subtotal + ${subtotal.toFixed(2)} +
+
+ Shipping + Calculated at checkout +
+
+
+ Total + ${subtotal.toFixed(2)} +
+ + Proceed to checkout + + + ← Continue shopping + +
+
+
+
+ ); +}