use @bigcommerce/storefront-data-hooks

This commit is contained in:
luc
2020-10-27 02:35:40 +01:00
parent 5962657b7d
commit c7b5c3ddc9
31 changed files with 70 additions and 58 deletions

View File

@@ -1,8 +1,8 @@
import type { FC } from 'react'
import cn from 'classnames'
import Link from 'next/link'
import type { ProductNode } from '@lib/bigcommerce/api/operations/get-all-products'
import usePrice from '@lib/bigcommerce/use-price'
import type { ProductNode } from '@bigcommerce/storefront-data-hooks/dist/api/operations/get-all-products'
import usePrice from '@bigcommerce/storefront-data-hooks/dist/use-price'
import { EnhancedImage } from '@components/core'
import s from './ProductCard.module.css'
import WishlistButton from '@components/wishlist/WishlistButton'

View File

@@ -10,8 +10,8 @@ import { Swatch, ProductSlider } from '@components/product'
import { Button, Container } from '@components/ui'
import { HTMLContent } from '@components/core'
import useAddItem from '@lib/bigcommerce/cart/use-add-item'
import type { ProductNode } from '@lib/bigcommerce/api/operations/get-product'
import useAddItem from '@bigcommerce/storefront-data-hooks/dist/cart/use-add-item'
import type { ProductNode } from '@bigcommerce/storefront-data-hooks/dist/api/operations/get-product'
import { getProductOptions } from '../helpers'
interface Props {

View File

@@ -1,4 +1,4 @@
import type { ProductNode } from '@lib/bigcommerce/api/operations/get-product'
import type { ProductNode } from '@bigcommerce/storefront-data-hooks/dist/api/operations/get-product'
export function getProductOptions(product: ProductNode) {
const options = product.productOptions.edges?.map(({ node }: any) => ({