-
Notifications
You must be signed in to change notification settings - Fork 3
/
pricingNameReviews.js
56 lines (52 loc) · 1.62 KB
/
pricingNameReviews.js
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React from "react";
import SnapshotGallery from "./snapshotGallery";
import Ratings from "react-ratings-declarative";
const PricingNameReviews = ({
productInfo,
productStyle,
styles,
changeHandler,
styleIndex,
rating,
}) => {
let price =
styleIndex === 0 ? productInfo.default_price : productStyle.original_price;
let sale = false;
if (productStyle.sale_price && productStyle.sale_price > 0) {
price = productStyle.sale_price;
sale = true;
}
return (
<>
<div className="overview-stars">
<Ratings rating={rating} widgetRatedColors="black">
<Ratings.Widget widgetDimension="12px" widgetSpacing="0px" />
<Ratings.Widget widgetDimension="12px" widgetSpacing="0px" />
<Ratings.Widget widgetDimension="12px" widgetSpacing="0px" />
<Ratings.Widget widgetDimension="12px" widgetSpacing="0px" />
<Ratings.Widget widgetDimension="12px" widgetSpacing="0px" />
</Ratings>
{" "}
<a
className="review-anchor-link"
style={{ color: "blue", textDecorationLine: "underline" }}
onClick={() => {
document.getElementById("anchor").scrollIntoView();
}}
>
Read All Reviews
</a>
</div>
{productInfo.category}
<h1>{productInfo.name}</h1>
<p style={sale ? { color: "red" } : null}>${price}</p>
<b>Style ></b> {productStyle.name ? productStyle.name : styles[0].name}
<SnapshotGallery
styles={styles}
changeHandler={changeHandler}
styleIndex={styleIndex}
/>
</>
);
};
export default PricingNameReviews;