From 5bceca6907dfa258e266efae4b0aef94240e40cf Mon Sep 17 00:00:00 2001 From: bender Date: Thu, 12 Mar 2026 06:23:33 +0000 Subject: [PATCH] Update src/app/product/[id]/page.tsx --- src/app/product/[id]/page.tsx | 158 ++++++++++++++++++++++------------ 1 file changed, 105 insertions(+), 53 deletions(-) diff --git a/src/app/product/[id]/page.tsx b/src/app/product/[id]/page.tsx index f7294c7..7946d79 100644 --- a/src/app/product/[id]/page.tsx +++ b/src/app/product/[id]/page.tsx @@ -6,7 +6,6 @@ import FooterCard from "@/components/sections/footer/FooterCard"; import { Instagram, Twitter, Youtube, ShoppingCart, Heart } from "lucide-react"; import Link from "next/link"; import { useState } from "react"; -import { useParams } from "next/navigation"; const TikTok = (props: React.SVGProps) => ( ) => ( ); -const products = [ - { - id: "1", name: "Classic Black Hoodie", price: "$89.99", imageSrc: "http://img.b2bpic.net/free-photo/medium-shot-man-posing-with-hoodie-indoors_23-2149359859.jpg", description: "Our signature black hoodie crafted from premium organic cotton blend. Features a relaxed fit, front kangaroo pocket, and reinforced stitching for durability.", details: "Material: 60% organic cotton, 40% polyester | Fit: Oversized | Care: Machine wash cold"}, - { - id: "2", name: "Vintage Denim Jacket", price: "$129.99", imageSrc: "http://img.b2bpic.net/free-photo/fashionable-woman-wearing-denim-jacket_23-2148859621.jpg", description: "A timeless denim jacket with authentic vintage vibes. Perfect layering piece for any streetwear aesthetic.", details: "Material: 100% denim | Fit: Relaxed | Care: Machine wash cold"}, -]; - -export default function ProductPage() { - const params = useParams(); - const productId = params.id as string; - const product = products.find((p) => p.id === productId) || products[0]; +interface PageProps { + params: { id: string }; +} +export default function ProductDetailPage({ params }: PageProps) { const navItems = [ { name: "Shop", id: "products" }, { name: "Collections", id: "collections" }, @@ -41,10 +33,32 @@ export default function ProductPage() { { name: "Contact", id: "contact" }, ]; - const [selectedSize, setSelectedSize] = useState("M"); const [quantity, setQuantity] = useState(1); + const [selectedSize, setSelectedSize] = useState("M"); + const [selectedColor, setSelectedColor] = useState("Black"); const [isFavorited, setIsFavorited] = useState(false); + const productId = params.id; + + const products: Record = { + "1": { + id: "1", name: "Classic Black Hoodie", price: 89.99, + description: "Experience ultimate comfort with our signature Classic Black Hoodie. Crafted from premium cotton blend, this versatile piece is perfect for any casual occasion. Features a spacious front pocket and adjustable drawstrings.", imageSrc: "http://img.b2bpic.net/free-photo/medium-shot-man-posing-with-hoodie-indoors_23-2149359859.jpg", sizes: ["XS", "S", "M", "L", "XL", "XXL"], + colors: ["Black", "Navy", "Charcoal"], + rating: 4.8, + reviews: 156, + }, + "2": { + id: "2", name: "Vintage Denim Jacket", price: 129.99, + description: "Make a statement with our Vintage Denim Jacket. This timeless piece features authentic fading and distressing for that perfect worn-in look. Premium quality denim with reinforced stitching ensures durability.", imageSrc: "http://img.b2bpic.net/free-photo/fashionable-woman-wearing-denim-jacket_23-2148859621.jpg", sizes: ["XS", "S", "M", "L", "XL"], + colors: ["Indigo", "Light Blue", "Black"], + rating: 4.9, + reviews: 203, + }, + }; + + const product = products[productId] || products["1"]; + const socialLinks = [ { icon: Instagram, href: "https://instagram.com/umbra", ariaLabel: "Instagram" }, { icon: Twitter, href: "https://twitter.com/umbra", ariaLabel: "Twitter" }, @@ -59,11 +73,11 @@ export default function ProductPage() { borderRadius="soft" contentWidth="smallMedium" sizing="medium" - background="noiseDiagonalGradient" + background="circleGradient" cardStyle="glass-elevated" - primaryButtonStyle="primary-glow" - secondaryButtonStyle="radial-glow" - headingFontWeight="light" + primaryButtonStyle="gradient" + secondaryButtonStyle="glass" + headingFontWeight="normal" >