Skip to content

Commit c912c2e

Browse files
committed
add ProductDetail component
1 parent ffa86be commit c912c2e

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import React, { useState } from 'react';
2+
import { motion } from 'framer-motion';
3+
import { ArrowLeft, ShoppingBag, Heart, Share2, ShieldCheck } from 'lucide-react';
4+
5+
const ProductDetail = ({ product, onBack }) => {
6+
const [selectedSize, setSelectedSize] = useState(null);
7+
const sizes = ['7', '8', '9', '10', '11'];
8+
9+
return (
10+
<div className="product-detail-container">
11+
<button className="back-btn" onClick={onBack}>
12+
<ArrowLeft size={18} /> BACK TO STORE
13+
</button>
14+
15+
<div className="detail-grid">
16+
<div className="image-display">
17+
<motion.img
18+
src={product.image}
19+
alt={product.name}
20+
initial={{ scale: 0.9, opacity: 0 }}
21+
animate={{ scale: 1, opacity: 1 }}
22+
transition={{ duration: 0.5 }}
23+
/>
24+
</div>
25+
26+
<div className="info-display">
27+
<span className="brand-tag">{product.brand}</span>
28+
<h1 className="product-title">{product.name}</h1>
29+
<p className="product-cat">{product.category}</p>
30+
31+
<div className="price-tag">{product.price}</div>
32+
33+
<div className="description-box">
34+
<p>{product.description}</p>
35+
</div>
36+
37+
<div className="size-selection">
38+
<div className="section-head">
39+
<h3>SELECT SIZE (UK)</h3>
40+
<span>SIZE CHART</span>
41+
</div>
42+
<div className="sizes-grid">
43+
{sizes.map(size => (
44+
<button
45+
key={size}
46+
className={`size-btn ${selectedSize === size ? 'active' : ''}`}
47+
onClick={() => setSelectedSize(size)}
48+
>
49+
{size}
50+
</button>
51+
))}
52+
</div>
53+
</div>
54+
55+
<div className="action-buttons">
56+
<button className="add-to-cart-btn btn-primary" onClick={() => alert('Added to cart!')}>
57+
<ShoppingBag size={20} /> ADD TO CART
58+
</button>
59+
<button className="wishlist-btn-large">
60+
<Heart size={20} /> WISHLIST
61+
</button>
62+
</div>
63+
64+
<div className="trust-badges">
65+
<div className="badge-item"><ShieldCheck size={18} /> 100% Authentic Products</div>
66+
<div className="badge-item"><Share2 size={18} /> Easy 30-Day Returns</div>
67+
</div>
68+
</div>
69+
</div>
70+
71+
</div>
72+
);
73+
};
74+
75+
export default ProductDetail;

0 commit comments

Comments
 (0)