added product link for cart item
This commit is contained in:
@@ -36,7 +36,7 @@ const { isLoading: cartImageIsLoading } = useImage({
|
||||
|
||||
const { mutateAsync: deleteCartItem, isPending: deleteCartItemIsPending } = useDeleteCartItem();
|
||||
|
||||
const { mutateAsync: addCartItem } = useAddCartItem();
|
||||
const { mutateAsync: addCartItem, isPending: addItemInCartQuantityIsPending } = useAddCartItem();
|
||||
|
||||
// methods
|
||||
|
||||
@@ -153,7 +153,7 @@ watch(
|
||||
</div>
|
||||
|
||||
<NuxtLink
|
||||
:to="`product/${data.product.id}`"
|
||||
:to="{ name: 'product-id', params: { id: data.product.slug } }"
|
||||
class="font-semibold typo-sub-h-sm lg:typo-sub-h-xl text-black underline underline-offset-2"
|
||||
>
|
||||
{{ data.product.title }}
|
||||
@@ -196,7 +196,22 @@ watch(
|
||||
/>
|
||||
</button>
|
||||
|
||||
<div class="size-10 flex-center">{{ counter }}</div>
|
||||
<div
|
||||
v-if="addItemInCartQuantityIsPending"
|
||||
class="size-10 flex-center"
|
||||
>
|
||||
<Icon
|
||||
:name="'svg-spinners:180-ring-with-bg'"
|
||||
class="size-[18px]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-else
|
||||
class="size-10 flex-center"
|
||||
>
|
||||
{{ counter }}
|
||||
</div>
|
||||
|
||||
<button
|
||||
@click="handleDecreaseQuantity"
|
||||
@@ -246,7 +261,20 @@ watch(
|
||||
/>
|
||||
</button>
|
||||
|
||||
<div class="size-10 text-sm flex-center">
|
||||
<div
|
||||
v-if="addItemInCartQuantityIsPending"
|
||||
class="size-10 text-sm flex-center"
|
||||
>
|
||||
<Icon
|
||||
:name="'svg-spinners:180-ring-with-bg'"
|
||||
class="size-[25px]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-else
|
||||
class="size-10 text-sm flex-center"
|
||||
>
|
||||
{{ counter }}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user