mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 14:06:59 +00:00
fix: replace shopify, ts errors
This commit is contained in:
parent
70873f3fd1
commit
ae2aecfb11
@ -4,7 +4,7 @@ import { PlusIcon } from '@heroicons/react/24/outline';
|
|||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { addItem } from 'components/cart/actions';
|
import { addItem } from 'components/cart/actions';
|
||||||
import LoadingDots from 'components/loading-dots';
|
import LoadingDots from 'components/loading-dots';
|
||||||
import { ProductVariant } from 'lib/shopify/types';
|
import { ProductVariant } from 'lib/medusa/types';
|
||||||
import { useRouter, useSearchParams } from 'next/navigation';
|
import { useRouter, useSearchParams } from 'next/navigation';
|
||||||
import { useTransition } from 'react';
|
import { useTransition } from 'react';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { Menu } from 'lib/shopify/types';
|
import { Menu } from 'lib/medusa/types';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { usePathname } from 'next/navigation';
|
import { usePathname } from 'next/navigation';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { AddToCart } from 'components/cart/add-to-cart';
|
import { AddToCart } from 'components/cart/add-to-cart';
|
||||||
import Price from 'components/price';
|
import Price from 'components/price';
|
||||||
import Prose from 'components/prose';
|
import Prose from 'components/prose';
|
||||||
import { Product } from 'lib/shopify/types';
|
import { Product } from 'lib/medusa/types';
|
||||||
import { VariantSelector } from './variant-selector';
|
import { VariantSelector } from './variant-selector';
|
||||||
|
|
||||||
export function ProductDescription({ product }: { product: Product }) {
|
export function ProductDescription({ product }: { product: Product }) {
|
||||||
|
@ -147,7 +147,8 @@ const reshapeLineItem = (lineItem: MedusaLineItem): CartItem => {
|
|||||||
},
|
},
|
||||||
availableForSale: true,
|
availableForSale: true,
|
||||||
variants: [lineItem.variant && reshapeProductVariant(lineItem.variant)],
|
variants: [lineItem.variant && reshapeProductVariant(lineItem.variant)],
|
||||||
handle: lineItem.variant?.product?.handle ?? ''
|
handle: lineItem.variant?.product?.handle ?? '',
|
||||||
|
options: [] as ProductOption[]
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectedOptions =
|
const selectedOptions =
|
||||||
@ -226,7 +227,7 @@ const reshapeProduct = (product: MedusaProduct): Product => {
|
|||||||
reshapeProductVariant(variant, product.options)
|
reshapeProductVariant(variant, product.options)
|
||||||
);
|
);
|
||||||
|
|
||||||
let options;
|
let options = [] as ProductOption[];
|
||||||
product.options && (options = product.options.map((option) => reshapeProductOption(option)));
|
product.options && (options = product.options.map((option) => reshapeProductOption(option)));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -68,7 +68,7 @@ export type Product = Partial<Omit<MedusaProduct, 'tags' | 'options' | 'variants
|
|||||||
descriptionHtml: string;
|
descriptionHtml: string;
|
||||||
tags: Array<string>;
|
tags: Array<string>;
|
||||||
availableForSale: boolean;
|
availableForSale: boolean;
|
||||||
options?: Array<ProductOption>;
|
options: Array<ProductOption>;
|
||||||
variants: Array<ProductVariant>;
|
variants: Array<ProductVariant>;
|
||||||
images?: Array<Image>;
|
images?: Array<Image>;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user