|
|
@ -39,6 +39,7 @@ const ProductDesign = ({ |
|
|
|
horizontalImg, |
|
|
|
horizontalImg, |
|
|
|
rangeWidth, |
|
|
|
rangeWidth, |
|
|
|
addToCartHolder, |
|
|
|
addToCartHolder, |
|
|
|
|
|
|
|
mainPriceTitle, |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
const [progressFlag, setProgressFlag] = useState(false); |
|
|
|
const [progressFlag, setProgressFlag] = useState(false); |
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
@ -91,7 +92,7 @@ const ProductDesign = ({ |
|
|
|
<div className="flex flex-wrap sm:flex-nowrap justify-around "> |
|
|
|
<div className="flex flex-wrap sm:flex-nowrap justify-around "> |
|
|
|
<div className="w-full flex flex-wrap items-center justify-around my-10 px-4"> |
|
|
|
<div className="w-full flex flex-wrap items-center justify-around my-10 px-4"> |
|
|
|
<div |
|
|
|
<div |
|
|
|
className={`w-full sm:w-60 md:w-72 mx-1 rounded-lg shadow-sm p-2 my-3 ${productHolderBorder} ${productHolderBorderColor}`} |
|
|
|
className={`group w-full sm:w-60 md:w-72 mx-1 rounded-lg shadow-sm p-2 my-3 relative cursor-pointer ${productHolderBorder} ${productHolderBorderColor} hover:border-0`} |
|
|
|
> |
|
|
|
> |
|
|
|
{/* product image */} |
|
|
|
{/* product image */} |
|
|
|
<div className="w-full relative group"> |
|
|
|
<div className="w-full relative group"> |
|
|
@ -161,9 +162,6 @@ const ProductDesign = ({ |
|
|
|
<ReactTooltip place="top" type="dark" effect="float" /> |
|
|
|
<ReactTooltip place="top" type="dark" effect="float" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
)} |
|
|
|
)} |
|
|
|
<button className="group-hover:opacity-100 bg-blueBgColor text-white rounded p-2 text-xs absolute left-1/2 bottom-7 transform -translate-x-1/2 -translate-y-1/2 opacity-0 transition duration-300"> |
|
|
|
|
|
|
|
افزودن به سبد خرید |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{/* product content */} |
|
|
|
{/* product content */} |
|
|
|
<div className="px-2"> |
|
|
|
<div className="px-2"> |
|
|
@ -207,18 +205,20 @@ const ProductDesign = ({ |
|
|
|
priceDirection.indexOf("col") !== -1 ? "inline" : "flex" |
|
|
|
priceDirection.indexOf("col") !== -1 ? "inline" : "flex" |
|
|
|
}`}
|
|
|
|
}`}
|
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
{mainPriceTitle && ( |
|
|
|
<span className="text-xs text-borderColor ml-2"> |
|
|
|
<span className="text-xs text-borderColor ml-2"> |
|
|
|
قیمت |
|
|
|
قیمت |
|
|
|
</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"> |
|
|
|
145<span>تومان</span> |
|
|
|
<span> قیمت</span> 140<span>تومان</span> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
)} |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<p className="text-sm text-productPrice font-semibold inline"> |
|
|
|
<p className="text-sm text-productPrice font-semibold inline"> |
|
|
|
145.000<span>تومان</span> |
|
|
|
130.000<span>تومان</span> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{/* add to cart */} |
|
|
|
{/* add to cart */} |
|
|
@ -257,6 +257,11 @@ const ProductDesign = ({ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
)} |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
{/* dark hover effect */} |
|
|
|
|
|
|
|
<div className="absolute right-0 bottom-0 h-full w-full group-hover:bg-black group-hover:rounded group-hover:border transition duration-300 opacity-50"></div> |
|
|
|
|
|
|
|
<button className="group-hover:opacity-100 bg-blueBgColor text-white rounded p-2 text-xs absolute left-1/2 bottom-1/2 transform -translate-x-1/2 -translate-y-1/2 opacity-0 transition duration-300"> |
|
|
|
|
|
|
|
افزودن به سبد خرید |
|
|
|
|
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -283,6 +288,7 @@ ProductDesign.defaultProps = { |
|
|
|
discount: true, |
|
|
|
discount: true, |
|
|
|
discountPricePercent: true, |
|
|
|
discountPricePercent: true, |
|
|
|
// product price
|
|
|
|
// product price
|
|
|
|
|
|
|
|
mainPriceTitle: false, |
|
|
|
discountPrice: true, |
|
|
|
discountPrice: true, |
|
|
|
priceHolder: true, |
|
|
|
priceHolder: true, |
|
|
|
|
|
|
|
|
|
|
|