4
0
forked from crowetic/commerce

More updates

This commit is contained in:
okbel
2021-01-19 12:33:50 -03:00
parent a8ae360cd4
commit 48b484011d
9 changed files with 57 additions and 50 deletions

View File

@@ -12,6 +12,7 @@ import useRemoveItem from '@framework/cart/use-remove-item'
const Item = ({
item,
currencyCode,
...rest
}: {
item: CartItem
currencyCode: string
@@ -79,6 +80,7 @@ const Item = ({
className={cn('flex flex-row space-x-8 py-8', {
'opacity-75 pointer-events-none': removing,
})}
{...rest}
>
<div className="w-16 h-16 bg-violet relative overflow-hidden">
<Image

View File

@@ -15,14 +15,14 @@ const CartSidebarView: FC = () => {
const { price: subTotal } = usePrice(
data && {
amount: data.subTotal,
amount: Number(data.subTotal),
currencyCode: data.currency?.code || 'USD',
}
)
const { price: total } = usePrice(
data && {
amount: data.total,
amount: Number(data.total),
currencyCode: data.currency?.code || 'USD',
}
)
@@ -94,7 +94,7 @@ const CartSidebarView: FC = () => {
My Cart
</h2>
<ul className="py-6 space-y-6 sm:py-0 sm:space-y-0 sm:divide-y sm:divide-accents-3 border-t border-accents-3">
{data?.products?.map((item) => (
{data?.items?.map((item) => (
<CartItem
key={item.id}
item={item}