Revert "Revert "Merge branch 'agnostic' of https://github.com/vercel/commerce into agnostic""

This reverts commit c9a43f1bce.
This commit is contained in:
cond0r
2021-02-09 14:40:38 +02:00
parent 954760865b
commit a934cb51fd
9 changed files with 342 additions and 123 deletions

View File

@@ -1,6 +1,7 @@
import { FC } from 'react'
import Link from 'next/link'
import cn from 'classnames'
import type { LineItem } from '@framework/types'
import useCart from '@framework/cart/use-cart'
import useCustomer from '@framework/customer/use-customer'
import { Heart, Bag } from '@components/icons'
@@ -15,7 +16,7 @@ interface Props {
const countItem = (count: number, item: LineItem) => count + item.quantity
const UserNav: FC<Props> = ({ className, children }) => {
const UserNav: FC<Props> = ({ className }) => {
const { data } = useCart()
const { data: customer } = useCustomer()
const { toggleSidebar, closeSidebarIfPresent, openModal } = useUI()

View File

@@ -42,8 +42,8 @@ const WishlistCard: FC<Props> = ({ product }) => {
setLoading(true)
try {
await addItem({
productId: Number(product.id),
variantId: Number(product.variants[0].id),
productId: product.id,
variantId: product.variants[0].id,
})
openSidebar()
setLoading(false)