Template
Product cards, header, footer, PDP, and typography reworked toward a leaner layout; adds shop policy pages backed by the Storefront API. - Type: switch to Geist Sans/Mono, regular-weight headings - Product cards: drop borders, rounded corners, and action buttons - Header: shorter bar, no bottom border, center-out hover underline, bag icon replacing the cart icon (drawer wording updated to match) - Footer: single line with policy links and social icons on bg-background - Policies: /policies/[handle] renders shop.privacyPolicy, termsOfService, refundPolicy, shippingPolicy, subscriptionPolicy (SSG, hourly revalidation) - PDP: image grid with mobile carousel + dots and click-to-zoom, sticky info column, colour swatches from option optionValues with a configurable name-to-colour fallback in config/swatches.ts, Shop-purple checkout button - Recommendations: left-aligned heading on bg-background - Ignore .env*.local and tsconfig.tsbuildinfo Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016jWbNNJLksC1QG8z8845FX
140 lines
2.5 KiB
JavaScript
140 lines
2.5 KiB
JavaScript
// Product Fragment for consistent product data
|
|
export const ProductFragment = `
|
|
fragment ProductFragment on Product {
|
|
id
|
|
title
|
|
handle
|
|
description
|
|
descriptionHtml
|
|
vendor
|
|
productType
|
|
tags
|
|
availableForSale
|
|
priceRange {
|
|
minVariantPrice {
|
|
amount
|
|
currencyCode
|
|
}
|
|
maxVariantPrice {
|
|
amount
|
|
currencyCode
|
|
}
|
|
}
|
|
compareAtPriceRange {
|
|
minVariantPrice {
|
|
amount
|
|
currencyCode
|
|
}
|
|
maxVariantPrice {
|
|
amount
|
|
currencyCode
|
|
}
|
|
}
|
|
images(first: 10) {
|
|
edges {
|
|
node {
|
|
id
|
|
url
|
|
altText
|
|
width
|
|
height
|
|
}
|
|
}
|
|
}
|
|
variants(first: 100) {
|
|
edges {
|
|
node {
|
|
id
|
|
title
|
|
availableForSale
|
|
quantityAvailable
|
|
selectedOptions {
|
|
name
|
|
value
|
|
}
|
|
price {
|
|
amount
|
|
currencyCode
|
|
}
|
|
compareAtPrice {
|
|
amount
|
|
currencyCode
|
|
}
|
|
image {
|
|
id
|
|
url
|
|
altText
|
|
width
|
|
height
|
|
}
|
|
}
|
|
}
|
|
}
|
|
options {
|
|
id
|
|
name
|
|
values
|
|
optionValues {
|
|
id
|
|
name
|
|
swatch {
|
|
color
|
|
image {
|
|
previewImage {
|
|
url
|
|
}
|
|
}
|
|
}
|
|
firstSelectableVariant {
|
|
id
|
|
image {
|
|
id
|
|
url
|
|
altText
|
|
width
|
|
height
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
// Get multiple products
|
|
export const GET_PRODUCTS_QUERY = `
|
|
${ProductFragment}
|
|
query GetProducts($first: Int!, $query: String, $sortKey: ProductSortKeys, $reverse: Boolean) {
|
|
products(first: $first, query: $query, sortKey: $sortKey, reverse: $reverse) {
|
|
edges {
|
|
node {
|
|
...ProductFragment
|
|
}
|
|
}
|
|
pageInfo {
|
|
hasNextPage
|
|
endCursor
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
// Get a single product by handle
|
|
export const GET_PRODUCT_QUERY = `
|
|
${ProductFragment}
|
|
query GetProduct($handle: String!) {
|
|
product(handle: $handle) {
|
|
...ProductFragment
|
|
}
|
|
}
|
|
`;
|
|
|
|
// Get product recommendations
|
|
export const QUERY_PRODUCT_RECOMMENDATIONS = `
|
|
${ProductFragment}
|
|
query GetProductRecommendations($productId: ID!) {
|
|
productRecommendations(productId: $productId) {
|
|
...ProductFragment
|
|
}
|
|
}
|
|
`;
|