mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
feat: implement variant selector panel
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
@@ -73,9 +73,6 @@ const productFragment = /* GraphQL */ `
|
||||
}
|
||||
tags
|
||||
updatedAt
|
||||
productType: metafield(namespace: "custom", key: "product_type") {
|
||||
value
|
||||
}
|
||||
}
|
||||
${imageFragment}
|
||||
${seoFragment}
|
||||
|
@@ -194,12 +194,11 @@ const reshapeProduct = (product: ShopifyProduct, filterHiddenProducts: boolean =
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const { images, variants, productType, ...rest } = product;
|
||||
const { images, variants, ...rest } = product;
|
||||
return {
|
||||
...rest,
|
||||
images: reshapeImages(images, product.title),
|
||||
variants: reshapeVariants(removeEdgesAndNodes(variants)),
|
||||
productType: productType?.value ?? null
|
||||
variants: reshapeVariants(removeEdgesAndNodes(variants))
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -62,10 +62,9 @@ export type Page = {
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export type Product = Omit<ShopifyProduct, 'variants' | 'images' | 'productType'> & {
|
||||
export type Product = Omit<ShopifyProduct, 'variants' | 'images'> & {
|
||||
variants: ProductVariant[];
|
||||
images: Image[];
|
||||
productType: string | null;
|
||||
};
|
||||
|
||||
export type ProductOption = {
|
||||
@@ -148,9 +147,6 @@ export type ShopifyProduct = {
|
||||
handle: string;
|
||||
}[];
|
||||
};
|
||||
productType: {
|
||||
value: string;
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type ShopifyCartOperation = {
|
||||
@@ -288,3 +284,9 @@ export type ShopifyProductsOperation = {
|
||||
sortKey?: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type CoreChargeOption = {
|
||||
label: string;
|
||||
value: string;
|
||||
price: Money;
|
||||
};
|
||||
|
Reference in New Issue
Block a user