|
|
@ -10,6 +10,7 @@ import exitIcon from "../../../assets/icons/exit.svg"; |
|
|
|
import deleteIcon from "../../../assets/icons/delete.svg"; |
|
|
|
import deleteIcon from "../../../assets/icons/delete.svg"; |
|
|
|
|
|
|
|
|
|
|
|
function Product({ product, grades, pushToCart, isMobile, loading }) { |
|
|
|
function Product({ product, grades, pushToCart, isMobile, loading }) { |
|
|
|
|
|
|
|
let id; |
|
|
|
return isMobile ? ( |
|
|
|
return isMobile ? ( |
|
|
|
<div className="flex flex-row justify-between py-5 border-b border-solid border-grayDB dark:border-gray45"> |
|
|
|
<div className="flex flex-row justify-between py-5 border-b border-solid border-grayDB dark:border-gray45"> |
|
|
|
<div className="flex flex-row"> |
|
|
|
<div className="flex flex-row"> |
|
|
@ -89,7 +90,12 @@ function Product({ product, grades, pushToCart, isMobile, loading }) { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<div className="flex flex-row w-full gap-10 py-4 border-b border-solid border-gray-200"> |
|
|
|
<div |
|
|
|
|
|
|
|
className="flex flex-row w-full gap-10 py-4 border-b border-solid border-gray-200" |
|
|
|
|
|
|
|
onClick={() => { |
|
|
|
|
|
|
|
id = product?.id; |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
> |
|
|
|
<div className="w-3/4 flex flex-row"> |
|
|
|
<div className="w-3/4 flex flex-row"> |
|
|
|
<img |
|
|
|
<img |
|
|
|
src={"https://dnvn.ir/api/v1/file/" + product?.product?.book?.fileIds} |
|
|
|
src={"https://dnvn.ir/api/v1/file/" + product?.product?.book?.fileIds} |
|
|
@ -119,7 +125,7 @@ function Product({ product, grades, pushToCart, isMobile, loading }) { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="w-1/4 flex flex-row items-center"> |
|
|
|
<div className="w-1/4 flex flex-row items-center"> |
|
|
|
<button |
|
|
|
<button |
|
|
|
className="rounded-md pt-2 pb-1.5 px-3 border border-solid border-blueC0 text-blueC0 text-lg ffont-bold" |
|
|
|
className="rounded-md pt-1 px-1.5 border border-solid border-blueC0 text-blueC0 text-lg font-bold" |
|
|
|
onClick={() => |
|
|
|
onClick={() => |
|
|
|
pushToCart({ |
|
|
|
pushToCart({ |
|
|
|
productId: product?.productId, |
|
|
|
productId: product?.productId, |
|
|
@ -130,8 +136,12 @@ function Product({ product, grades, pushToCart, isMobile, loading }) { |
|
|
|
> |
|
|
|
> |
|
|
|
+ |
|
|
|
+ |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
<span className="mx-2.5 font-semibold text-lg text-green4F w-8 flex justify-center"> |
|
|
|
<span className="mx-2.5 font-semibold text-5xl text-green4F w-8 flex justify-center"> |
|
|
|
{loading ? <Loading size={2} color="bg-green-500" /> : product.count} |
|
|
|
{loading ? ( |
|
|
|
|
|
|
|
<Loading size={2} color="bg-green-500" /> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
product.count |
|
|
|
|
|
|
|
)} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
{ |
|
|
|
{ |
|
|
|
<> |
|
|
|
<> |
|
|
@ -154,7 +164,7 @@ function Product({ product, grades, pushToCart, isMobile, loading }) { |
|
|
|
/> |
|
|
|
/> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<button |
|
|
|
<button |
|
|
|
className="rounded-md pt-2 pb-1.5 font-bold px-3.5 border border-solid border-blueC0 text-blueC0 dark:border-blueC0 dark:text-blueC0 text-lg" |
|
|
|
className="rounded-md px-2 font-bold border border-solid border-blueC0 text-blueC0 dark:border-blueC0 dark:text-blueC0 text-2xl" |
|
|
|
onClick={() => |
|
|
|
onClick={() => |
|
|
|
pushToCart({ |
|
|
|
pushToCart({ |
|
|
|
productId: product?.productId, |
|
|
|
productId: product?.productId, |
|
|
|