|
|
|
@ -32,6 +32,9 @@ const VodProductDesign = ({ |
|
|
|
|
productTitleColor, |
|
|
|
|
productCat, |
|
|
|
|
rangeHolder, |
|
|
|
|
priceTitle, |
|
|
|
|
productPriceAmountTitle, |
|
|
|
|
addToCartHolder, |
|
|
|
|
verticalImg, |
|
|
|
|
horizontalImg, |
|
|
|
|
}) => { |
|
|
|
@ -55,6 +58,7 @@ const VodProductDesign = ({ |
|
|
|
|
<div |
|
|
|
|
className={`w-full sm:w-60 md:w-96 mx-1 rounded-lg shadow-sm p-2 my-3 ${productHolderBorder} ${productHolderBorderColor}`} |
|
|
|
|
> |
|
|
|
|
{/* img */} |
|
|
|
|
<div |
|
|
|
|
className="w-full relative flex items-center justify-center cursor-pointer" |
|
|
|
|
style={{ |
|
|
|
@ -79,7 +83,8 @@ const VodProductDesign = ({ |
|
|
|
|
)} |
|
|
|
|
</div> |
|
|
|
|
<div className="px-2"> |
|
|
|
|
<div className="mt-4"> |
|
|
|
|
{/* content */} |
|
|
|
|
<div className="mt-4 flex justify-between items-center"> |
|
|
|
|
<h2 |
|
|
|
|
className={`text-productTitle leading-4 text-sm ${productTitleColor} ${productTitleAlignment}`} |
|
|
|
|
> |
|
|
|
@ -97,48 +102,59 @@ const VodProductDesign = ({ |
|
|
|
|
</span> |
|
|
|
|
)} |
|
|
|
|
</div> |
|
|
|
|
{star && ( |
|
|
|
|
<div className="flex items-center mt-2"> |
|
|
|
|
<StarRating /> |
|
|
|
|
<span className="text-xs text-productContent font-bold mr-2"> |
|
|
|
|
39 |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
)} |
|
|
|
|
{priceHolder && ( |
|
|
|
|
<div |
|
|
|
|
className={`flex items-center justify-between ${priceDirection}`} |
|
|
|
|
> |
|
|
|
|
{/* price */} |
|
|
|
|
<div className="mt-2"> |
|
|
|
|
<div |
|
|
|
|
className={`${ |
|
|
|
|
priceDirection.indexOf("col") !== -1 ? "inline" : "flex" |
|
|
|
|
}`}
|
|
|
|
|
> |
|
|
|
|
<span className="text-xs text-borderColor ml-2"> |
|
|
|
|
قیمت |
|
|
|
|
</span> |
|
|
|
|
{discountPrice && ( |
|
|
|
|
<p className="line-through text-xs text-borderColor mr-2"> |
|
|
|
|
145<span>تومان</span> |
|
|
|
|
</p> |
|
|
|
|
)} |
|
|
|
|
{/* price */} |
|
|
|
|
<div className="flex items-center justify-between mt-2"> |
|
|
|
|
{priceHolder && ( |
|
|
|
|
<div |
|
|
|
|
className={`flex items-center justify-between ${priceDirection}`} |
|
|
|
|
> |
|
|
|
|
{/* price */} |
|
|
|
|
<div className="mt-2"> |
|
|
|
|
<div |
|
|
|
|
className={`${ |
|
|
|
|
priceDirection.indexOf("col") !== -1 |
|
|
|
|
? "inline" |
|
|
|
|
: "flex" |
|
|
|
|
}`}
|
|
|
|
|
> |
|
|
|
|
{priceTitle && ( |
|
|
|
|
<span className="text-xs text-borderColor ml-2"> |
|
|
|
|
قیمت |
|
|
|
|
</span> |
|
|
|
|
)} |
|
|
|
|
{discountPrice && ( |
|
|
|
|
<p className="line-through text-xs text-borderColor mr-2"> |
|
|
|
|
145<span>تومان</span> |
|
|
|
|
</p> |
|
|
|
|
)} |
|
|
|
|
</div> |
|
|
|
|
<p |
|
|
|
|
className={`text-sm font-semibold inline ${productPriceAmountTitle}`} |
|
|
|
|
> |
|
|
|
|
145.000<span>تومان</span> |
|
|
|
|
</p> |
|
|
|
|
</div> |
|
|
|
|
<p className="text-sm text-productPrice font-semibold inline"> |
|
|
|
|
145.000<span>تومان</span> |
|
|
|
|
</p> |
|
|
|
|
{/* add to cart */} |
|
|
|
|
{addToCartHolder && ( |
|
|
|
|
<button |
|
|
|
|
className={`rounded-2xl px-2 py-3 border text-xs text-productPrice mt-2 ${ |
|
|
|
|
priceDirection.indexOf("col") !== -1 ? "w-full" : "" |
|
|
|
|
}`}
|
|
|
|
|
> |
|
|
|
|
اضافه کردن به سبد خرید |
|
|
|
|
</button> |
|
|
|
|
)} |
|
|
|
|
</div> |
|
|
|
|
{/* add to cart */} |
|
|
|
|
<button |
|
|
|
|
className={`rounded-2xl px-2 py-3 border text-xs text-productPrice mt-2 ${ |
|
|
|
|
priceDirection.indexOf("col") !== -1 ? "w-full" : "" |
|
|
|
|
}`}
|
|
|
|
|
> |
|
|
|
|
اضافه کردن به سبد خرید |
|
|
|
|
</button> |
|
|
|
|
</div> |
|
|
|
|
)} |
|
|
|
|
)} |
|
|
|
|
{star && ( |
|
|
|
|
<div className="flex items-center mt-2"> |
|
|
|
|
<StarRating /> |
|
|
|
|
<span className="text-xs text-productContent font-bold mr-2"> |
|
|
|
|
39 |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
)} |
|
|
|
|
</div> |
|
|
|
|
{productTags && ( |
|
|
|
|
<div className="mt-2 flex flex-wrap"> |
|
|
|
|
<button className="rounded bg-productTagBg text-productTag m-1 px-4 py-1 text-xs"> |
|
|
|
@ -153,7 +169,7 @@ const VodProductDesign = ({ |
|
|
|
|
</div> |
|
|
|
|
)} |
|
|
|
|
{rangeHolder && ( |
|
|
|
|
<div className="bg-rangeBgColor h-3 w-full rounded mt-2"> |
|
|
|
|
<div className="bg-rangeBgColor h-3 w-full rounded mt-4"> |
|
|
|
|
<div className="bg-rangeFillBgColor h-3 w-44 rounded"></div> |
|
|
|
|
</div> |
|
|
|
|
)} |
|
|
|
@ -167,6 +183,9 @@ const VodProductDesign = ({ |
|
|
|
|
|
|
|
|
|
export default VodProductDesign; |
|
|
|
|
|
|
|
|
|
// text colors i used:
|
|
|
|
|
// text-productPrice
|
|
|
|
|
|
|
|
|
|
VodProductDesign.defaultProps = { |
|
|
|
|
colors: false, |
|
|
|
|
likeBtn: false, |
|
|
|
@ -174,15 +193,19 @@ VodProductDesign.defaultProps = { |
|
|
|
|
discountPricePercent: false, |
|
|
|
|
discountPrice: false, |
|
|
|
|
productContent: false, |
|
|
|
|
star: false, |
|
|
|
|
star: true, |
|
|
|
|
productTags: false, |
|
|
|
|
priceHolder: false, |
|
|
|
|
priceHolder: true, |
|
|
|
|
priceTitle: false, |
|
|
|
|
productCat: true, |
|
|
|
|
rangeHolder: true, |
|
|
|
|
verticalImg: false, |
|
|
|
|
horizontalImg: true, |
|
|
|
|
addToCartHolder: false, |
|
|
|
|
|
|
|
|
|
productTitleColor: "text-darkCrimsonTextColor", |
|
|
|
|
productHolderBorder: "border-0", |
|
|
|
|
productPriceAmountTitle: "text-productPrice", |
|
|
|
|
productHolderBorder: "border", |
|
|
|
|
productHolderBorderColor: "border-grayBorderColor", |
|
|
|
|
productTitleAlignment: "text-justify", |
|
|
|
|
|
|
|
|
|