|
|
@ -10,51 +10,46 @@ const maxDesktopSize = 1250; |
|
|
|
|
|
|
|
|
|
|
|
const fontSize = { |
|
|
|
const fontSize = { |
|
|
|
mobile: { |
|
|
|
mobile: { |
|
|
|
h1: window.innerWidth > maxMobileSize ? 18 : window.innerWidth / 26, |
|
|
|
h1: window.innerWidth > maxMobileSize ? 18 : window.innerWidth / 22, |
|
|
|
h2: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 34, |
|
|
|
h2: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 34, |
|
|
|
div: window.innerWidth > maxMobileSize ? 18 : window.innerWidth / 32, |
|
|
|
div: window.innerWidth > maxMobileSize ? 18 : window.innerWidth / 32, |
|
|
|
|
|
|
|
a: window.innerWidth > maxMobileSize ? 15 : window.innerWidth / 26, |
|
|
|
}, |
|
|
|
}, |
|
|
|
desktop: { |
|
|
|
desktop: { |
|
|
|
h1: window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 70, |
|
|
|
h1: window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 70, |
|
|
|
div: window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 85, |
|
|
|
div: window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 85, |
|
|
|
old: window.innerWidth > maxDesktopSize ? 9 : window.innerWidth / 120, |
|
|
|
old: window.innerWidth > maxDesktopSize ? 9 : window.innerWidth / 120, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
export default class Product extends Component { |
|
|
|
export default class Product extends Component { |
|
|
|
render() { |
|
|
|
render() { |
|
|
|
const { product, id } = this.props; |
|
|
|
const { product, id } = this.props; |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
{window.innerWidth < 1000 ? ( |
|
|
|
{window.innerWidth < 1000 ? ( |
|
|
|
<div |
|
|
|
<div className="mobile-products-product d-flex flex-column"> |
|
|
|
className="mobile-mybooks__item d-flex flex-column" |
|
|
|
|
|
|
|
style={{ |
|
|
|
|
|
|
|
borderBottomLeftRadius: Number(id) % 2 === 1 ? 30 : 0, |
|
|
|
|
|
|
|
borderBottomRightRadius: Number(id) % 2 === 0 ? 30 : 0, |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<img src={product.image} alt={"عکس مجصول"} /> |
|
|
|
<img src={product.image} alt={"عکس مجصول"} /> |
|
|
|
<div className="mobile-mybooks__item--buttons d-flex flex-column"> |
|
|
|
<div className="mobile-products-product__info d-flex flex-column"> |
|
|
|
|
|
|
|
<h1 style={{ fontSize: fontSize.mobile.h1 }}>{product.title}</h1> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div className="mobile-products-product__links d-flex mt-2"> |
|
|
|
<Link |
|
|
|
<Link |
|
|
|
style={{ |
|
|
|
style={{ fontSize: fontSize.mobile.a }} |
|
|
|
background: product.status.digital ? "#FFEE00" : "#FFFFFF", |
|
|
|
className="mobile-products-product__links--physical" |
|
|
|
fontSize: fontSize.mobile.a, |
|
|
|
|
|
|
|
color: product.status.ar ? "#4D4D4F" : "#4D4D4F", |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
کتاب دیجیتال |
|
|
|
کتاب دیجیتال |
|
|
|
{ !product.status.digital ? <img src={basket} alt="افزودن به سبد خرید" /> : null} |
|
|
|
{!product.status.digital ? ( |
|
|
|
|
|
|
|
<img src={basket} alt="افزودن به سبد خرید" /> |
|
|
|
|
|
|
|
) : null} |
|
|
|
</Link> |
|
|
|
</Link> |
|
|
|
<Link |
|
|
|
<Link |
|
|
|
style={{ |
|
|
|
style={{ fontSize: fontSize.mobile.a }} |
|
|
|
background: product.status.ar ? "#00CC69" : "#FFFFFF", |
|
|
|
className="mobile-products-product__links--ar" |
|
|
|
color: product.status.ar ? "#FFFFFF" : "#4D4D4F", |
|
|
|
|
|
|
|
fontSize: fontSize.mobile.a, |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
واقعیت افزوده |
|
|
|
واقعیت افزوده |
|
|
|
{ !product.status.ar ? <img src={basket} alt="افزودن به سبد خرید" /> : null} |
|
|
|
{!product.status.ar ? ( |
|
|
|
|
|
|
|
<img src={basket} alt="افزودن به سبد خرید" /> |
|
|
|
|
|
|
|
) : null} |
|
|
|
</Link> |
|
|
|
</Link> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -63,23 +58,34 @@ export default class Product extends Component { |
|
|
|
<article className="products-product d-flex flex-column align-items"> |
|
|
|
<article className="products-product d-flex flex-column align-items"> |
|
|
|
<Link to={`/products/${product.id}`}> |
|
|
|
<Link to={`/products/${product.id}`}> |
|
|
|
<img src={product.image} alt={product.title} /> |
|
|
|
<img src={product.image} alt={product.title} /> |
|
|
|
<h1 style={{ fontSize: fontSize.desktop.h1 }}>{product.title + ' ' + product.subTitle}</h1> |
|
|
|
<h1 style={{ fontSize: fontSize.desktop.h1 }}> |
|
|
|
|
|
|
|
{product.title + " " + product.subTitle} |
|
|
|
|
|
|
|
</h1> |
|
|
|
{product.price ? ( |
|
|
|
{product.price ? ( |
|
|
|
<div className="products-product__price d-flex justify-content-center align-items-center"> |
|
|
|
<div className="products-product__price d-flex justify-content-center align-items-center"> |
|
|
|
{product.oldPrice ? ( |
|
|
|
{product.oldPrice ? ( |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<div style={{ fontSize: fontSize.desktop.old }} className="products-product__price--old d-flex"> |
|
|
|
<div |
|
|
|
|
|
|
|
style={{ fontSize: fontSize.desktop.old }} |
|
|
|
|
|
|
|
className="products-product__price--old d-flex" |
|
|
|
|
|
|
|
> |
|
|
|
{product.oldPrice} تومان |
|
|
|
{product.oldPrice} تومان |
|
|
|
<span></span> |
|
|
|
<span></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
<div style={{ fontSize: fontSize.desktop.div }} className="products-product__price--price"> |
|
|
|
<div |
|
|
|
|
|
|
|
style={{ fontSize: fontSize.desktop.div }} |
|
|
|
|
|
|
|
className="products-product__price--price" |
|
|
|
|
|
|
|
> |
|
|
|
{product.price} تومان |
|
|
|
{product.price} تومان |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<div style={{ fontSize: fontSize.desktop.div }} className="products-product__notAvailabe"> |
|
|
|
<div |
|
|
|
|
|
|
|
style={{ fontSize: fontSize.desktop.div }} |
|
|
|
|
|
|
|
className="products-product__notAvailabe" |
|
|
|
|
|
|
|
> |
|
|
|
ناموجود |
|
|
|
ناموجود |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
)} |
|
|
|
)} |
|
|
@ -90,4 +96,3 @@ export default class Product extends Component { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|