update src/components/Product/index.js

temp
mahdi 2 years ago
parent c26602cdbc
commit 5da07bf32b
  1. 21
      src/components/Product/index.js

@ -4,7 +4,6 @@ import { connect } from "react-redux";
import separate from "../../utils/separate"; import separate from "../../utils/separate";
import StarRating from "../StarRating"; import StarRating from "../StarRating";
import book from "./goldon.png"; import book from "./goldon.png";
import heart from "./vuesax-linear-heart.svg"; import heart from "./vuesax-linear-heart.svg";
import discountImg from "./discount.png"; import discountImg from "./discount.png";
@ -29,7 +28,7 @@ const ProductDesign = ({
hoverMode, hoverMode,
starRate, starRate,
imageSize, imageSize,
type type,
}) => { }) => {
const [isHovering, setIsHovering] = useState(false); const [isHovering, setIsHovering] = useState(false);
return ( return (
@ -93,8 +92,9 @@ const ProductDesign = ({
<p <p
className={`text-justify mt-2 text-xs leading-6 ${productExcerptTextColor}`} className={`text-justify mt-2 text-xs leading-6 ${productExcerptTextColor}`}
> >
این کتاب شامل گلدان و گیاه و خاک می باشد و همچنین آپشن های خوب {window.t(
دیگری نیز دارد. "این کتاب شامل گلدان و گیاه و خاک می باشد و همچنین آپشن های خوب دیگری نیز دارد."
)}
</p> </p>
)} )}
{productCat && ( {productCat && (
@ -123,18 +123,19 @@ const ProductDesign = ({
> >
{writeGHEIMAT && ( {writeGHEIMAT && (
<span className="text-xs text-borderColor ml-2"> <span className="text-xs text-borderColor ml-2">
قیمت {window.t("قیمت")}
</span> </span>
)} )}
{/* price with line on it */} {/* price with line on it */}
{discountPrice && ( {discountPrice && (
<p className="line-through text-xs text-borderColor mr-2"> <p className="line-through text-xs text-borderColor mr-2">
145<span>تومان</span> 145<span>{window.t("تومان")}</span>
</p> </p>
)} )}
</div> </div>
<p className="text-lg text-productPrice font-semibold inline text-green4F"> <p className="text-lg text-productPrice font-semibold inline text-green4F">
{separate(product.product[type]?.price)} <span>تومان</span> {separate(product.product[type]?.price)}{" "}
<span>{window.t("تومان")}</span>
</p> </p>
</div> </div>
{/* add to cart */} {/* add to cart */}
@ -144,7 +145,7 @@ const ProductDesign = ({
priceDirection.indexOf("col") !== -1 ? "w-full" : "" priceDirection.indexOf("col") !== -1 ? "w-full" : ""
}`} }`}
> >
اضافه کردن به سبد خرید {window.t("اضافه کردن به سبد خرید")}
</button> </button>
)} )}
</div> </div>
@ -157,7 +158,7 @@ const ProductDesign = ({
isHovering ? "" : "hidden" isHovering ? "" : "hidden"
}`} }`}
> >
<button>افزودن به سبد خرید</button> <button>{window.t("افزودن به سبد خرید")}</button>
</div> </div>
</div> </div>
) : null} ) : null}
@ -191,7 +192,7 @@ export default connect(mapStateToProps)(ProductDesign);
ProductDesign.defaultProps = { ProductDesign.defaultProps = {
// icons on product image // icons on product image
type : 0, type: 0,
colors: false, colors: false,
likeBtn: false, likeBtn: false,
discount: false, discount: false,

Loading…
Cancel
Save