Add image component to cart items

This commit is contained in:
Luis Alvarez
2020-10-21 21:41:06 -05:00
parent dc80358bc6
commit a02f58bbf2
3 changed files with 10 additions and 9 deletions

View File

@@ -1,8 +1,10 @@
import { ChangeEvent, useEffect, useState } from 'react'
import Image from 'next/image'
import { Trash, Plus, Minus } from '@components/icon'
import usePrice from '@lib/bigcommerce/use-price'
import useUpdateItem from '@lib/bigcommerce/cart/use-update-item'
import useRemoveItem from '@lib/bigcommerce/cart/use-remove-item'
import { ChangeEvent, useEffect, useState } from 'react'
import getPathname from '@lib/get-pathname'
import s from './CartItem.module.css'
const CartItem = ({
@@ -56,7 +58,7 @@ const CartItem = ({
return (
<li className="flex flex-row space-x-8 py-6">
<div className="w-12 h-12 bg-violet relative overflow-hidden">
<img className={s.productImage} src={item.image_url} />
<Image src={getPathname(item.image_url)} width={60} height={60} />
</div>
<div className="flex-1 flex flex-col justify-between text-base">
<span className="font-bold mb-3">{item.name}</span>