Skip to content

Commit

Permalink
Merge branch 'perf' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasKn committed Dec 7, 2023
2 parents c7d7955 + cb4cb4c commit 445b689
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion templates/hydrogen-theme/app/components/CollectionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function CollectionCard(props: {

return (
<div className="overflow-hidden rounded-lg border">
<Link prefetch="viewport" to={`/collections/${collection.handle}`}>
<Link prefetch="intent" to={`/collections/${collection.handle}`}>
{collection.image && (
<Image
aspectRatio="16/9"
Expand Down
2 changes: 1 addition & 1 deletion templates/hydrogen-theme/app/components/ProductCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function ProductCard(props: {
return (
<div className="overflow-hidden rounded-lg border">
{!skeleton && product && firstVariant ? (
<Link prefetch="viewport" to={`/products/${product.handle}`}>
<Link prefetch="intent" to={`/products/${product.handle}`}>
{firstVariant?.image && (
<Image
aspectRatio="16/9"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export function MediaGallery() {
data={media}
mediaOptions={{
image: {
loading: 'eager',
sizes: '(min-width: 1024px) 50vw, 100vw',
},
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function SanityInternalLink(props: {

// Todo: add Navlink support
return (
<Link className={className} prefetch="viewport" to={url}>
<Link className={className} prefetch="intent" to={url}>
{children ? children : name}
</Link>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ export default function Collection() {
{collection.image && (
<section>
<div className="relative h-80 w-full overflow-hidden">
<Image className="" crop="center" data={collection.image} />
<Image
crop="center"
data={collection.image}
loading="eager"
sizes="100vw"
/>
<div className="absolute inset-0">
<div className="flex h-full items-center justify-center text-white">
<h1>{collection.title}</h1>
Expand Down

0 comments on commit 445b689

Please sign in to comment.