mirror of
https://github.com/vercel/commerce.git
synced 2025-05-11 20:27:51 +00:00
refactoring
This commit is contained in:
parent
be65e581f3
commit
86a083d72d
@ -5,7 +5,6 @@ import { GridTileImage } from 'components/grid/tile';
|
|||||||
import Footer from 'components/layout/footer';
|
import Footer from 'components/layout/footer';
|
||||||
import { Gallery } from 'components/product/gallery';
|
import { Gallery } from 'components/product/gallery';
|
||||||
import { ProductDescription } from 'components/product/product-description';
|
import { ProductDescription } from 'components/product/product-description';
|
||||||
import { HIDDEN_PRODUCT_TAG } from 'lib/constants';
|
|
||||||
import { getProduct, getProductRecommendations } from 'lib/shopify';
|
import { getProduct, getProductRecommendations } from 'lib/shopify';
|
||||||
import { Image } from 'lib/shopify/types';
|
import { Image } from 'lib/shopify/types';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
@ -21,7 +20,7 @@ export async function generateMetadata({
|
|||||||
if (!product) return notFound();
|
if (!product) return notFound();
|
||||||
|
|
||||||
const { url, width, height, altText: alt } = product.featuredImage || {};
|
const { url, width, height, altText: alt } = product.featuredImage || {};
|
||||||
const indexable = !product.tags.includes(HIDDEN_PRODUCT_TAG);
|
const indexable = product.availableForSale;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: product.seo.title || product.title,
|
title: product.seo.title || product.title,
|
||||||
|
@ -26,6 +26,4 @@ export const TAGS = {
|
|||||||
cart: 'cart'
|
cart: 'cart'
|
||||||
};
|
};
|
||||||
|
|
||||||
export const HIDDEN_PRODUCT_TAG = 'nextjs-frontend-hidden';
|
|
||||||
export const DEFAULT_OPTION = 'Default Title';
|
export const DEFAULT_OPTION = 'Default Title';
|
||||||
export const SHOPIFY_GRAPHQL_API_ENDPOINT = '/api/2023-01/graphql.json';
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user