From 99781bbc813c4bbbb443d6fccddfe04c9957fef2 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 13 Mar 2026 19:39:46 +0000 Subject: [PATCH] Add src/app/product/[id]/page.tsx --- src/app/product/[id]/page.tsx | 352 ++++++++++++++++++++++++++++++++++ 1 file changed, 352 insertions(+) create mode 100644 src/app/product/[id]/page.tsx diff --git a/src/app/product/[id]/page.tsx b/src/app/product/[id]/page.tsx new file mode 100644 index 0000000..9029da0 --- /dev/null +++ b/src/app/product/[id]/page.tsx @@ -0,0 +1,352 @@ +"use client"; + +import { useState } from "react"; +import Link from "next/link"; +import { useParams } from "next/navigation"; +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline"; +import FooterBaseCard from "@/components/sections/footer/FooterBaseCard"; +import { Heart, Share2, ChevronLeft, Check } from "lucide-react"; + +export default function ProductPage() { + const params = useParams(); + const productId = params.id as string; + + const navItems = [ + { name: "Home", id: "home" }, + { name: "Shop", id: "shop" }, + { name: "Brands", id: "brands" }, + { name: "New Arrivals", id: "new-arrivals" }, + { name: "Best Sellers", id: "best-sellers" }, + { name: "About", id: "about" }, + { name: "Contact", id: "contact" }, + ]; + + const footerColumns = [ + { + title: "Shop", items: [ + { label: "All Products", href: "/shop" }, + { label: "New Arrivals", href: "/shop" }, + { label: "Best Sellers", href: "/shop" }, + { label: "Brands", href: "/shop" }, + ], + }, + { + title: "Company", items: [ + { label: "About Us", href: "/" }, + { label: "Contact", href: "/" }, + { label: "Blog", href: "/" }, + { label: "Careers", href: "#" }, + ], + }, + { + title: "Support", items: [ + { label: "Shipping & Returns", href: "/" }, + { label: "FAQ", href: "/" }, + { label: "Size Guide", href: "#" }, + { label: "Track Order", href: "#" }, + ], + }, + { + title: "Legal", items: [ + { label: "Privacy Policy", href: "#" }, + { label: "Terms & Conditions", href: "#" }, + { label: "Cookie Policy", href: "#" }, + { label: "Accessibility", href: "#" }, + ], + }, + ]; + + const allProducts = [ + { + id: "prod-001", brand: "Nike", name: "Air Max 90 Classic", price: "$129.99", rating: 4.8, + reviewCount: "342", imageSrc: "http://img.b2bpic.net/free-photo/athletic-girl-standing-stairs-tying-shoelaces_23-2148264960.jpg?_wi=2", imageAlt: "Nike Air Max 90 sneaker in white and grey", category: "Shoes", size: ["6", "7", "8", "9", "10", "11", "12"], + stock: 45, + description: "Experience timeless style with the Nike Air Max 90 Classic. Featuring the iconic Air Max sole unit and premium leather construction, these sneakers deliver exceptional comfort and durability. Perfect for everyday wear or making a statement with classic sneaker culture."}, + { + id: "prod-002", brand: "Supreme", name: "Box Logo Hoodie", price: "$345.00", rating: 4.9, + reviewCount: "521", imageSrc: "http://img.b2bpic.net/free-photo/afro-hair-style-doing-okay-gesture_140725-36572.jpg?_wi=2", imageAlt: "Supreme black box logo hoodie", category: "Tops", size: ["XS", "S", "M", "L", "XL", "XXL"], + stock: 12, + description: "The Supreme Box Logo Hoodie is an iconic piece of streetwear history. Crafted with premium materials and featuring the legendary box logo, this hoodie represents supreme quality and style. Perfect for collectors and enthusiasts alike."}, + { + id: "prod-003", brand: "Carhartt WIP", name: "Detroit Jacket", price: "$159.99", rating: 4.7, + reviewCount: "189", imageSrc: "http://img.b2bpic.net/free-photo/portrait-beautiful-smiling-brunette-model-dressed-summer-hipster-jacket-jeans-clothes_158538-1617.jpg?_wi=2", imageAlt: "Carhartt WIP brown Detroit work jacket", category: "Jackets", size: ["XS", "S", "M", "L", "XL"], + stock: 28, + description: "The Carhartt WIP Detroit Jacket blends timeless workwear heritage with modern streetwear aesthetics. Featuring durable canvas construction and signature Carhartt craftsmanship, this jacket is built to last and designed to impress."}, + { + id: "prod-004", brand: "Stüssy", name: "Classic T-Shirt", price: "$48.00", rating: 4.6, + reviewCount: "276", imageSrc: "http://img.b2bpic.net/free-photo/t-shirt-painting-indoors-still-life_23-2150572721.jpg?_wi=2", imageAlt: "Stüssy white classic logo t-shirt", category: "Tops", size: ["XS", "S", "M", "L", "XL", "XXL"], + stock: 156, + description: "The Stüssy Classic T-Shirt is a wardrobe staple featuring the iconic Stüssy logo. Made from premium cotton, this tee offers exceptional comfort and quality. A versatile piece that pairs well with any outfit."}, + { + id: "prod-005", brand: "Adidas", name: "Ultra Boost 22", price: "$189.99", rating: 4.8, + reviewCount: "437", imageSrc: "http://img.b2bpic.net/free-photo/side-view-sports-shoes_23-2147618070.jpg", imageAlt: "Adidas Ultra Boost 22 in black", category: "Shoes", size: ["6", "7", "8", "9", "10", "11", "12", "13"], + stock: 34, + description: "Step into the future with the Adidas Ultra Boost 22. Featuring Boost technology and responsive cushioning, these shoes provide ultimate comfort for performance and lifestyle wear. Engineered for excellence."}, + ]; + + const product = allProducts.find((p) => p.id === productId); + + const [selectedSize, setSelectedSize] = useState(null); + const [quantity, setQuantity] = useState(1); + const [isFavorited, setIsFavorited] = useState(false); + const [addedToCart, setAddedToCart] = useState(false); + + if (!product) { + return ( + + +
+
+

Product not found

+ + Back to Shop + +
+
+ +
+ ); + } + + const handleAddToCart = () => { + if (selectedSize) { + setAddedToCart(true); + setTimeout(() => setAddedToCart(false), 2000); + } + }; + + return ( + + + +
+
+ {/* Breadcrumb */} + + + Back to Shop + + +
+ {/* Product Image */} +
+
+ {product.imageAlt} +
+
+ {[1, 2, 3, 4].map((i) => ( +
+ {`Product +
+ ))} +
+
+ + {/* Product Details */} +
+ {/* Brand and Title */} +
+

{product.brand}

+

{product.name}

+ + {/* Rating */} +
+
+ {Array.from({ length: 5 }).map((_, i) => ( + + ★ + + ))} +
+ ({product.reviewCount} reviews) +
+
+ + {/* Price and Stock */} +
+

{product.price}

+

10 ? "text-green-600" : product.stock > 0 ? "text-orange-600" : "text-red-600" + }`}> + {product.stock > 0 ? ( + <> + + {product.stock} in stock + + ) : ( + "Out of stock" + )} +

+
+ + {/* Description */} +
+

Product Description

+

{product.description}

+
+ + {/* Size Selection */} +
+

Select Size

+
+ {product.size.map((size) => ( + + ))} +
+
+ + {/* Quantity and Actions */} +
+
+ + {quantity} + +
+
+ + {/* Add to Cart Button */} + + + {/* Wishlist and Share */} +
+ + +
+ + {/* Additional Info */} +
+

✓ 100% Authentic Guarantee

+

✓ Free Shipping on orders over $100

+

✓ 30-Day Return Policy

+

✓ Secure Checkout

+
+
+
+
+
+ + +
+ ); +} \ No newline at end of file