mirror of
https://github.com/vercel/commerce.git
synced 2025-03-14 22:42:33 +00:00
Fixed some types
This commit is contained in:
parent
2f903cc66c
commit
d9243880a3
@ -75,6 +75,8 @@ const CartItem = ({
|
||||
setRemoving(false)
|
||||
}
|
||||
}
|
||||
// TODO: Add a type for this
|
||||
const options = (item as any).options
|
||||
|
||||
useEffect(() => {
|
||||
// Reset the quantity state if the item quantity changes
|
||||
@ -95,8 +97,8 @@ const CartItem = ({
|
||||
className={s.productImage}
|
||||
width={150}
|
||||
height={150}
|
||||
src={item.variant.image.url}
|
||||
alt={item.variant.image.altText}
|
||||
src={item.variant.image!.url}
|
||||
alt={item.variant.image!.altText}
|
||||
unoptimized
|
||||
/>
|
||||
</div>
|
||||
@ -109,15 +111,15 @@ const CartItem = ({
|
||||
{item.name}
|
||||
</span>
|
||||
</Link>
|
||||
{item.options && item.options.length > 0 ? (
|
||||
{options && options.length > 0 ? (
|
||||
<div className="">
|
||||
{item.options.map((option: ItemOption, i: number) => (
|
||||
{options.map((option: ItemOption, i: number) => (
|
||||
<span
|
||||
key={`${item.id}-${option.name}`}
|
||||
className="text-sm font-semibold text-accents-7"
|
||||
>
|
||||
{option.value}
|
||||
{i === item.options.length - 1 ? '' : ', '}
|
||||
{i === options.length - 1 ? '' : ', '}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user