-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProduct.js
More file actions
26 lines (23 loc) · 738 Bytes
/
Product.js
File metadata and controls
26 lines (23 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import React from "react";
import { NavLink } from "react-router-dom";
import FormatPrice from "../Helpers/FormatPrice";
const Product = (curElem) => {
const { id, name, image, price, category } = curElem;
return (
<NavLink to={`/singleproduct/${id}`}>
<div className="card">
<figure>
<img src={image} alt={name} />
<figcaption className="caption">{category}</figcaption>
</figure>
<div className="card-data">
<div className="card-data-flex">
<h3>{name}</h3>
<p className="card-data--price">{<FormatPrice price={price} />}</p>
</div>
</div>
</div>
</NavLink>
);
};
export default Product;