Skip to content

Commit

Permalink
refactor(CartItem): Update CartItem component to include lazy loading…
Browse files Browse the repository at this point in the history
… for images, quantity input, and subtotal wrapper
  • Loading branch information
kooya3 committed Aug 12, 2024
1 parent bd5f6db commit ce54650
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion src/app/(pages)/cart/CartItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,46 @@ const CartItem = ({ product, title, metaImage, qty, addItemToCart }) => {
)}
</Link>


<div className={classes.itemDetails}>
<div className={classes.titleWrapper}>
<h6>{title}</h6>
<Price product={product} button={false} />
</div>

<div className={classes.quantity}>
<div className={classes.quantityBtn} onClick={decrementQty}>
<Image
src="/assets/icons/minus.svg"
alt="minus"
width={24}
height={24}
className={classes.qtnBt}
/>
</div>

<input
type="text"
className={classes.quantityInput}
value={quantity}
onChange={enterQty}
/>

<div className={classes.quantityBtn} onClick={incrementQty}>
<Image
src="/assets/icons/plus.svg"
alt="plus"
width={24}
height={24}
className={classes.qtnBt}
/>
</div>
</div>
</div>

<div className={classes.subtotalWrapper}>
<Price product={product} button={false} quantity={quantity} />
<RemoveFromCartButton product={product} />
</div>

</li>
)
Expand Down

0 comments on commit ce54650

Please sign in to comment.