Template
Compare commits
5
Commits
3884e9524d
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0263a59c6a | ||
|
|
a230187e9f | ||
|
|
70ebd65a18 | ||
|
|
82c9626c75 | ||
|
|
58742d5d00 |
@@ -1,6 +1,6 @@
|
|||||||
import AccountForm from '@/components/shopify/account-form';
|
import AccountForm from '@/components/shopify/account-form';
|
||||||
|
|
||||||
export const metadata = { title: 'Activate your account — Shop' };
|
export const metadata = { title: 'Activate your account' };
|
||||||
|
|
||||||
// Shopify's emailed activation link is /account/activate/{id}/{token}.
|
// Shopify's emailed activation link is /account/activate/{id}/{token}.
|
||||||
export default async function Page({
|
export default async function Page({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import AccountForm, { AccountFormLink } from '@/components/shopify/account-form';
|
import AccountForm, { AccountFormLink } from '@/components/shopify/account-form';
|
||||||
|
|
||||||
export const metadata = { title: 'Sign in — Shop' };
|
export const metadata = { title: 'Sign in' };
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import OrderHistory from '@/components/shopify/order-history';
|
|||||||
import { getSessionToken } from '@/services/shopify/session';
|
import { getSessionToken } from '@/services/shopify/session';
|
||||||
import { getCustomer } from '@/services/shopify/customer';
|
import { getCustomer } from '@/services/shopify/customer';
|
||||||
|
|
||||||
export const metadata = { title: 'Order history — Shop' };
|
export const metadata = { title: 'Order history' };
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const token = await getSessionToken();
|
const token = await getSessionToken();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import AccountForm, { AccountFormLink } from '@/components/shopify/account-form';
|
import AccountForm, { AccountFormLink } from '@/components/shopify/account-form';
|
||||||
|
|
||||||
export const metadata = { title: 'Reset password — Shop' };
|
export const metadata = { title: 'Reset password' };
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import AccountForm, { AccountFormLink } from '@/components/shopify/account-form';
|
import AccountForm, { AccountFormLink } from '@/components/shopify/account-form';
|
||||||
|
|
||||||
export const metadata = { title: 'Create account — Shop' };
|
export const metadata = { title: 'Create account' };
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import AccountForm from '@/components/shopify/account-form';
|
import AccountForm from '@/components/shopify/account-form';
|
||||||
|
|
||||||
export const metadata = { title: 'Set a new password — Shop' };
|
export const metadata = { title: 'Set a new password' };
|
||||||
|
|
||||||
// Shopify's emailed reset link is /account/reset/{id}/{token}.
|
// Shopify's emailed reset link is /account/reset/{id}/{token}.
|
||||||
export default async function Page({
|
export default async function Page({
|
||||||
|
|||||||
@@ -1,4 +1,52 @@
|
|||||||
|
import type { Metadata } from 'next';
|
||||||
import CollectionDetail from '@/components/shopify/collection-detail';
|
import CollectionDetail from '@/components/shopify/collection-detail';
|
||||||
|
import { getCollectionProductsPage } from '@/services/shopify/catalog';
|
||||||
|
import { truncate } from '@/lib/utils';
|
||||||
|
|
||||||
|
export async function generateMetadata({
|
||||||
|
params,
|
||||||
|
}: {
|
||||||
|
params: Promise<{ handle: string }>;
|
||||||
|
}): Promise<Metadata> {
|
||||||
|
const { handle } = await params;
|
||||||
|
|
||||||
|
// No collection-only query exists, so ask for the smallest page of products
|
||||||
|
// and use just the collection node off it.
|
||||||
|
const { collection } = await getCollectionProductsPage(handle, {
|
||||||
|
first: 1,
|
||||||
|
}).catch(() => ({ collection: null }));
|
||||||
|
|
||||||
|
if (!collection) return { title: 'Collection' };
|
||||||
|
|
||||||
|
const description = collection.description
|
||||||
|
? truncate(collection.description, 160)
|
||||||
|
: `Shop the ${collection.title} collection.`;
|
||||||
|
|
||||||
|
return {
|
||||||
|
title: collection.title,
|
||||||
|
description,
|
||||||
|
alternates: { canonical: `/collections/${collection.handle}` },
|
||||||
|
openGraph: {
|
||||||
|
title: collection.title,
|
||||||
|
description,
|
||||||
|
url: `/collections/${collection.handle}`,
|
||||||
|
images: collection.image
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
url: collection.image.url,
|
||||||
|
alt: collection.image.altText ?? collection.title,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: undefined,
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
card: 'summary_large_image',
|
||||||
|
title: collection.title,
|
||||||
|
description,
|
||||||
|
images: collection.image ? [collection.image.url] : undefined,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
return <CollectionDetail />;
|
return <CollectionDetail />;
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
|
import type { Metadata } from 'next';
|
||||||
import Collections from '@/components/shopify/collections';
|
import Collections from '@/components/shopify/collections';
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: 'Collections',
|
||||||
|
description: 'Browse every collection in the store.',
|
||||||
|
};
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
return <Collections title="Our Collections" />;
|
return <Collections title="Our Collections" />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import type { Metadata } from 'next';
|
||||||
import './globals.css';
|
import './globals.css';
|
||||||
import { Geist, Geist_Mono } from 'next/font/google';
|
import { Geist, Geist_Mono } from 'next/font/google';
|
||||||
import Header from '@/components/shopify/header';
|
import Header from '@/components/shopify/header';
|
||||||
@@ -16,6 +17,29 @@ const geistMono = Geist_Mono({
|
|||||||
variable: '--font-geist-mono',
|
variable: '--font-geist-mono',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Routes only set their own `title`; the template appends the store name, and
|
||||||
|
// everything else here is inherited unless a page overrides it.
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
metadataBase: new URL(site.url),
|
||||||
|
title: {
|
||||||
|
default: site.storeName,
|
||||||
|
template: `%s — ${site.storeName}`,
|
||||||
|
},
|
||||||
|
description: site.description,
|
||||||
|
openGraph: {
|
||||||
|
type: 'website',
|
||||||
|
siteName: site.storeName,
|
||||||
|
title: site.storeName,
|
||||||
|
description: site.description,
|
||||||
|
url: '/',
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
card: 'summary_large_image',
|
||||||
|
title: site.storeName,
|
||||||
|
description: site.description,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
|
import type { Metadata } from 'next';
|
||||||
import Products from '@/components/shopify/products';
|
import Products from '@/components/shopify/products';
|
||||||
|
import { site } from '@/config/site';
|
||||||
|
|
||||||
|
// The home page keeps the bare store name, so `title.absolute` opts out of the
|
||||||
|
// root template rather than rendering "Shop — Shop".
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: { absolute: site.storeName },
|
||||||
|
description: site.description,
|
||||||
|
};
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { notFound } from 'next/navigation';
|
import { notFound } from 'next/navigation';
|
||||||
import { getShopPolicy, POLICY_HANDLES } from '@/hooks/use-shopify-policies';
|
import { getShopPolicy, POLICY_HANDLES } from '@/hooks/use-shopify-policies';
|
||||||
|
import { site } from '@/config/site';
|
||||||
|
|
||||||
export function generateStaticParams() {
|
export function generateStaticParams() {
|
||||||
return POLICY_HANDLES.map((handle) => ({ handle }));
|
return POLICY_HANDLES.map((handle) => ({ handle }));
|
||||||
@@ -13,8 +14,12 @@ export async function generateMetadata({
|
|||||||
const { handle } = await params;
|
const { handle } = await params;
|
||||||
const policy = await getShopPolicy(handle);
|
const policy = await getShopPolicy(handle);
|
||||||
|
|
||||||
|
if (!policy) return { title: 'Policy' };
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: policy ? `${policy.title} — Shop` : 'Policy — Shop',
|
title: policy.title,
|
||||||
|
description: `Read the ${policy.title.toLowerCase()} for ${site.storeName}.`,
|
||||||
|
alternates: { canonical: `/policies/${policy.handle}` },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,47 @@
|
|||||||
|
import type { Metadata } from 'next';
|
||||||
import ProductDetail from '@/components/shopify/product-detail';
|
import ProductDetail from '@/components/shopify/product-detail';
|
||||||
import ProductRecommendations from '@/components/shopify/product-recommendations';
|
import ProductRecommendations from '@/components/shopify/product-recommendations';
|
||||||
|
import { getProduct } from '@/services/shopify/catalog';
|
||||||
|
import { truncate } from '@/lib/utils';
|
||||||
|
import { site } from '@/config/site';
|
||||||
|
|
||||||
|
export async function generateMetadata({
|
||||||
|
params,
|
||||||
|
}: {
|
||||||
|
params: Promise<{ handle: string }>;
|
||||||
|
}): Promise<Metadata> {
|
||||||
|
const { handle } = await params;
|
||||||
|
|
||||||
|
// ProductDetail fetches client-side and renders its own empty state, so a
|
||||||
|
// failed lookup here falls back to generic tags rather than a 500.
|
||||||
|
const product = await getProduct(handle).catch(() => null);
|
||||||
|
if (!product) return { title: 'Product' };
|
||||||
|
|
||||||
|
const description = product.description
|
||||||
|
? truncate(product.description, 160)
|
||||||
|
: site.description;
|
||||||
|
const image = product.images.edges[0]?.node;
|
||||||
|
|
||||||
|
return {
|
||||||
|
title: product.title,
|
||||||
|
description,
|
||||||
|
alternates: { canonical: `/products/${product.handle}` },
|
||||||
|
openGraph: {
|
||||||
|
title: product.title,
|
||||||
|
description,
|
||||||
|
url: `/products/${product.handle}`,
|
||||||
|
images: image
|
||||||
|
? [{ url: image.url, alt: image.altText ?? product.title }]
|
||||||
|
: undefined,
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
card: 'summary_large_image',
|
||||||
|
title: product.title,
|
||||||
|
description,
|
||||||
|
images: image ? [image.url] : undefined,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
+2
-1
@@ -2,7 +2,8 @@ import { Suspense } from 'react';
|
|||||||
import SearchResults from '@/components/shopify/search-results';
|
import SearchResults from '@/components/shopify/search-results';
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
title: 'Search — Shop',
|
title: 'Search',
|
||||||
|
description: 'Search the catalogue by product name, description or type.',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
|
import type { Metadata } from 'next';
|
||||||
import Collections from '@/components/shopify/collections';
|
import Collections from '@/components/shopify/collections';
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: 'Collections',
|
||||||
|
description: 'Browse every collection in the store.',
|
||||||
|
// Same listing as /collections; point crawlers at the canonical route.
|
||||||
|
alternates: { canonical: '/collections' },
|
||||||
|
};
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
return <Collections title="Our Collections" />;
|
return <Collections title="Our Collections" />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
import Image from 'next/image';
|
||||||
import { useCartStore, redirectToCheckout } from '@/hooks/use-shopify-cart';
|
import { useCartStore, redirectToCheckout } from '@/hooks/use-shopify-cart';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Loader } from '@/components/ui/loader';
|
import { Loader } from '@/components/ui/loader';
|
||||||
@@ -171,9 +172,11 @@ const CartDrawer: React.FC = () => {
|
|||||||
{/* Product Image */}
|
{/* Product Image */}
|
||||||
<div className="w-16 h-16 bg-zinc-100 overflow-hidden shrink-0">
|
<div className="w-16 h-16 bg-zinc-100 overflow-hidden shrink-0">
|
||||||
{image ? (
|
{image ? (
|
||||||
<img
|
<Image
|
||||||
src={image}
|
src={image}
|
||||||
alt={item.merchandise.product.title}
|
alt={item.merchandise.product.title}
|
||||||
|
width={64}
|
||||||
|
height={64}
|
||||||
className="w-full h-full object-cover"
|
className="w-full h-full object-cover"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
import Image from 'next/image';
|
||||||
|
|
||||||
interface CollectionImage {
|
interface CollectionImage {
|
||||||
url: string;
|
url: string;
|
||||||
@@ -27,10 +28,12 @@ const CollectionCard: React.FC<CollectionCardProps> = ({ collection }) => {
|
|||||||
{/* Collection Image */}
|
{/* Collection Image */}
|
||||||
<div className="relative aspect-square overflow-hidden">
|
<div className="relative aspect-square overflow-hidden">
|
||||||
{collection.image ? (
|
{collection.image ? (
|
||||||
<img
|
<Image
|
||||||
src={collection.image.url}
|
src={collection.image.url}
|
||||||
alt={collection.image.altText || collection.title}
|
alt={collection.image.altText || collection.title}
|
||||||
className="w-full h-full object-cover transition-transform duration-500 group-hover:scale-[1.04]"
|
fill
|
||||||
|
sizes="(min-width: 1024px) 25vw, 50vw"
|
||||||
|
className="object-cover transition-transform duration-500 group-hover:scale-[1.04]"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="absolute inset-0 flex items-center justify-center text-zinc-300">
|
<div className="absolute inset-0 flex items-center justify-center text-zinc-300">
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ interface HeaderProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Header: React.FC<HeaderProps> = ({
|
const Header: React.FC<HeaderProps> = ({
|
||||||
storeName = 'Shop',
|
storeName = 'Logo',
|
||||||
logoUrl,
|
logoUrl,
|
||||||
links = [
|
links = [
|
||||||
{ label: 'Shop', url: '/' },
|
{ label: 'Shop', url: '/' },
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
import Image from 'next/image';
|
||||||
import { RiImageLine } from '@remixicon/react';
|
import { RiImageLine } from '@remixicon/react';
|
||||||
import type { Customer, CustomerOrder } from '@/services/shopify/customer';
|
import type { Customer, CustomerOrder } from '@/services/shopify/customer';
|
||||||
|
|
||||||
@@ -123,9 +124,11 @@ const OrderHistory: React.FC<OrderHistoryProps> = ({ customer }) => {
|
|||||||
<li key={index} className="flex items-start gap-x-3">
|
<li key={index} className="flex items-start gap-x-3">
|
||||||
<div className="h-16 w-16 shrink-0 overflow-hidden bg-zinc-100">
|
<div className="h-16 w-16 shrink-0 overflow-hidden bg-zinc-100">
|
||||||
{node.variant?.image ? (
|
{node.variant?.image ? (
|
||||||
<img
|
<Image
|
||||||
src={node.variant.image.url}
|
src={node.variant.image.url}
|
||||||
alt={node.variant.image.altText || node.title}
|
alt={node.variant.image.altText || node.title}
|
||||||
|
width={64}
|
||||||
|
height={64}
|
||||||
className="h-full w-full object-cover"
|
className="h-full w-full object-cover"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
import Image from 'next/image';
|
||||||
import { truncate } from '@/lib/utils';
|
import { truncate } from '@/lib/utils';
|
||||||
|
|
||||||
interface ProductImage {
|
interface ProductImage {
|
||||||
@@ -68,10 +69,12 @@ const ProductCard: React.FC<ProductCardProps> = ({ product }) => {
|
|||||||
{/* Product Image */}
|
{/* Product Image */}
|
||||||
<div className="relative aspect-square overflow-hidden">
|
<div className="relative aspect-square overflow-hidden">
|
||||||
{firstImage ? (
|
{firstImage ? (
|
||||||
<img
|
<Image
|
||||||
src={firstImage.url}
|
src={firstImage.url}
|
||||||
alt={firstImage.altText || product.title}
|
alt={firstImage.altText || product.title}
|
||||||
className="w-full h-full object-contain transition-transform duration-500 group-hover:scale-[1.04]"
|
fill
|
||||||
|
sizes="(min-width: 1280px) 20vw, (min-width: 1024px) 25vw, (min-width: 640px) 33vw, 50vw"
|
||||||
|
className="object-contain transition-transform duration-500 group-hover:scale-[1.04]"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="absolute inset-0 flex items-center justify-center text-zinc-300">
|
<div className="absolute inset-0 flex items-center justify-center text-zinc-300">
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
import Image from 'next/image';
|
||||||
import { RiCloseLine } from '@remixicon/react';
|
import { RiCloseLine } from '@remixicon/react';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
|
|
||||||
interface ProductImage {
|
interface ProductImage {
|
||||||
url: string;
|
url: string;
|
||||||
altText?: string | null;
|
altText?: string | null;
|
||||||
|
width?: number | null;
|
||||||
|
height?: number | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ProductDetailGalleryProps {
|
interface ProductDetailGalleryProps {
|
||||||
@@ -136,11 +139,14 @@ const ProductDetailGallery: React.FC<ProductDetailGalleryProps> = ({
|
|||||||
isSingle ? 'sm:col-span-2' : ''
|
isSingle ? 'sm:col-span-2' : ''
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<img
|
<Image
|
||||||
src={image.url}
|
src={image.url}
|
||||||
alt={image.altText || 'Product image'}
|
alt={image.altText || 'Product image'}
|
||||||
|
fill
|
||||||
|
sizes="(min-width: 1024px) 30vw, (min-width: 640px) 50vw, 100vw"
|
||||||
|
priority={index === 0}
|
||||||
draggable={false}
|
draggable={false}
|
||||||
className="w-full h-full object-cover select-none"
|
className="object-cover select-none"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
@@ -173,11 +179,19 @@ const ProductDetailGallery: React.FC<ProductDetailGalleryProps> = ({
|
|||||||
onClick={close}
|
onClick={close}
|
||||||
className="fixed inset-0 z-100 flex items-center justify-center bg-foreground/20 backdrop-blur-md p-6 md:p-10"
|
className="fixed inset-0 z-100 flex items-center justify-center bg-foreground/20 backdrop-blur-md p-6 md:p-10"
|
||||||
>
|
>
|
||||||
<img
|
<Image
|
||||||
src={zoomedImage.url}
|
src={zoomedImage.url}
|
||||||
alt={zoomedImage.altText || 'Product image'}
|
alt={zoomedImage.altText || 'Product image'}
|
||||||
|
// Shopify gives us the intrinsic size; the square fallback only
|
||||||
|
// reserves space until CSS scales it down to fit the overlay.
|
||||||
|
width={zoomedImage.width || 1600}
|
||||||
|
height={zoomedImage.height || 1600}
|
||||||
|
sizes="100vw"
|
||||||
onClick={(event) => event.stopPropagation()}
|
onClick={(event) => event.stopPropagation()}
|
||||||
className="max-h-full max-w-full object-contain"
|
// w/h-auto keeps the box at the image's own ratio; without it the
|
||||||
|
// width+height attributes make both axes definite and the element
|
||||||
|
// stretches to the overlay, swallowing backdrop clicks that close it.
|
||||||
|
className="max-h-full max-w-full w-auto h-auto object-contain"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
import Image from 'next/image';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
import {
|
import {
|
||||||
CommandDialog,
|
CommandDialog,
|
||||||
@@ -162,9 +163,11 @@ const SearchDialog: React.FC = () => {
|
|||||||
>
|
>
|
||||||
<div className="h-14 w-14 shrink-0 overflow-hidden bg-zinc-100">
|
<div className="h-14 w-14 shrink-0 overflow-hidden bg-zinc-100">
|
||||||
{product.featuredImage ? (
|
{product.featuredImage ? (
|
||||||
<img
|
<Image
|
||||||
src={product.featuredImage.url}
|
src={product.featuredImage.url}
|
||||||
alt={product.featuredImage.altText || product.title}
|
alt={product.featuredImage.altText || product.title}
|
||||||
|
width={56}
|
||||||
|
height={56}
|
||||||
className="h-full w-full object-cover"
|
className="h-full w-full object-cover"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -3,6 +3,15 @@ import type { NavLink } from '@/components/shopify/header';
|
|||||||
/** Chrome shared by every route — rendered once in the root layout. */
|
/** Chrome shared by every route — rendered once in the root layout. */
|
||||||
export const site = {
|
export const site = {
|
||||||
storeName: 'Shop',
|
storeName: 'Shop',
|
||||||
|
description:
|
||||||
|
'An agent-friendly Shopify storefront built with Next.js and Hydrogen.',
|
||||||
|
// Absolute origin behind `metadataBase`, so Open Graph images resolve to full
|
||||||
|
// URLs. Vercel injects VERCEL_PROJECT_PRODUCTION_URL on deployed builds.
|
||||||
|
url:
|
||||||
|
process.env.NEXT_PUBLIC_SITE_URL ??
|
||||||
|
(process.env.VERCEL_PROJECT_PRODUCTION_URL
|
||||||
|
? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
|
||||||
|
: 'http://localhost:3000'),
|
||||||
logoUrl: '',
|
logoUrl: '',
|
||||||
copyright: '© 2026 Shop. All rights reserved.',
|
copyright: '© 2026 Shop. All rights reserved.',
|
||||||
navLinks: [
|
navLinks: [
|
||||||
|
|||||||
+2
-2
@@ -4,15 +4,15 @@ export default {
|
|||||||
ignoreBuildErrors: true,
|
ignoreBuildErrors: true,
|
||||||
},
|
},
|
||||||
images: {
|
images: {
|
||||||
unoptimized: true,
|
|
||||||
remotePatterns: [
|
remotePatterns: [
|
||||||
{
|
{
|
||||||
protocol: 'https',
|
protocol: 'https',
|
||||||
hostname: 'images.unsplash.com',
|
hostname: 'images.unsplash.com',
|
||||||
},
|
},
|
||||||
|
// Covers cdn.shopify.com plus any other Shopify-hosted image subdomain.
|
||||||
{
|
{
|
||||||
protocol: 'https',
|
protocol: 'https',
|
||||||
hostname: 'cdn.shopify.com',
|
hostname: '**.shopify.com',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
protocol: 'https',
|
protocol: 'https',
|
||||||
|
|||||||
Reference in New Issue
Block a user