4
0
forked from crowetic/commerce
This commit is contained in:
Belen Curcio 2020-10-14 17:56:50 -03:00
parent e6ba938f38
commit 0c8100ddcb
2 changed files with 11 additions and 6 deletions

View File

@ -7,3 +7,11 @@
.quantity::-webkit-inner-spin-button { .quantity::-webkit-inner-spin-button {
@apply appearance-none m-0; @apply appearance-none m-0;
} }
.productImage {
position: absolute;
top: 0;
left: -10px;
top: 15px;
transform: scale(1.9);
}

View File

@ -3,7 +3,7 @@ import usePrice from '@lib/bigcommerce/use-price'
import useUpdateItem from '@lib/bigcommerce/cart/use-update-item' import useUpdateItem from '@lib/bigcommerce/cart/use-update-item'
import useRemoveItem from '@lib/bigcommerce/cart/use-remove-item' import useRemoveItem from '@lib/bigcommerce/cart/use-remove-item'
import { ChangeEvent, useEffect, useState } from 'react' import { ChangeEvent, useEffect, useState } from 'react'
import styles from './CartItem.module.css' import s from './CartItem.module.css'
const CartItem = ({ const CartItem = ({
item, item,
@ -58,10 +58,7 @@ const CartItem = ({
return ( return (
<li className="flex flex-row space-x-8 py-6"> <li className="flex flex-row space-x-8 py-6">
<div className="w-12 h-12 bg-violet relative overflow-hidden"> <div className="w-12 h-12 bg-violet relative overflow-hidden">
<img <img className={s.productImage} src={item.image_url} />
className="w-full absolute top-3 left-0 -ml-3 transform scale-150"
src={item.image_url}
/>
</div> </div>
<div className="flex-1 flex flex-col justify-between text-primary"> <div className="flex-1 flex flex-col justify-between text-primary">
<span className="font-bold mb-3">{item.name}</span> <span className="font-bold mb-3">{item.name}</span>
@ -73,7 +70,7 @@ const CartItem = ({
type="number" type="number"
max={99} max={99}
min={0} min={0}
className={styles.quantity} className={s.quantity}
value={quantity} value={quantity}
onChange={handleQuantity} onChange={handleQuantity}
onBlur={handleBlur} onBlur={handleBlur}