menu item
This commit is contained in:
@@ -100,6 +100,8 @@ const MenuItem = ({ product, variantId: variantIdProp, variantValue: variantValu
|
|||||||
};
|
};
|
||||||
|
|
||||||
const productDetailUrl = `/${name}/${product.id}?category=${product.category.id}`;
|
const productDetailUrl = `/${name}/${product.id}?category=${product.category.id}`;
|
||||||
|
const actionButtonClass = "bg-background active:drop-shadow-xs rounded-md h-8 inline-flex p-1 justify-center items-center gap-2 relative overflow-hidden";
|
||||||
|
const actionButtonLabelClass = "text-sm2 pt-0.5 font-normal text-foreground";
|
||||||
|
|
||||||
if (viewMode === "grid") {
|
if (viewMode === "grid") {
|
||||||
return (
|
return (
|
||||||
@@ -123,8 +125,8 @@ const MenuItem = ({ product, variantId: variantIdProp, variantValue: variantValu
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{showDetailsInsteadOfAdd ? (
|
{showDetailsInsteadOfAdd ? (
|
||||||
<Link href={productDetailUrl} className="bg-background active:drop-shadow-xs w-full rounded-md h-8 inline-flex justify-center items-center gap-2 px-2 text-sm2 font-normal text-foreground">
|
<Link href={productDetailUrl} className={`${actionButtonClass} w-full`}>
|
||||||
جزئیات
|
<span className={actionButtonLabelClass}>جزئیات</span>
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<CartQuantityControl quantity={quantity} onAdd={handleAddToCart} onRemove={handleRemoveFromCart} isMutating={isCartMutating} fullWidth />
|
<CartQuantityControl quantity={quantity} onAdd={handleAddToCart} onRemove={handleRemoveFromCart} isMutating={isCartMutating} fullWidth />
|
||||||
@@ -164,10 +166,12 @@ const MenuItem = ({ product, variantId: variantIdProp, variantValue: variantValu
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col justify-end shrink-0">
|
<div className="flex flex-col justify-end shrink-0">
|
||||||
{showDetailsInsteadOfAdd ? (
|
{showDetailsInsteadOfAdd ? (
|
||||||
<Link href={productDetailUrl} className="bg-background active:drop-shadow-xs rounded-full h-8 inline-flex items-center gap-1.5 px-3 text-sm2 font-normal text-foreground whitespace-nowrap">
|
<div className="w-[115px]">
|
||||||
جزئیات
|
<Link href={productDetailUrl} className={`${actionButtonClass} w-full`}>
|
||||||
<ArrowLeft size={16} className="stroke-foreground" />
|
<span className={actionButtonLabelClass}>جزئیات</span>
|
||||||
</Link>
|
<ArrowLeft size={16} className="stroke-foreground" />
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="w-[115px]">
|
<div className="w-[115px]">
|
||||||
<CartQuantityControl quantity={quantity} onAdd={handleAddToCart} onRemove={handleRemoveFromCart} isMutating={isCartMutating} />
|
<CartQuantityControl quantity={quantity} onAdd={handleAddToCart} onRemove={handleRemoveFromCart} isMutating={isCartMutating} />
|
||||||
|
|||||||
Reference in New Issue
Block a user