Skip to content

Commit

Permalink
Removes priority on third grid item on home page
Browse files Browse the repository at this point in the history
  • Loading branch information
manovotny committed Aug 3, 2023
1 parent 80bb15a commit e1454d3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions components/grid/three-items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ import { getCollectionProducts } from 'lib/shopify';
import type { Product } from 'lib/shopify/types';
import Link from 'next/link';

function ThreeItemGridItem({ item, size }: { item: Product; size: 'full' | 'half' }) {
function ThreeItemGridItem({
item,
size,
priority
}: {
item: Product;
size: 'full' | 'half';
priority?: boolean;
}) {
return (
<div
className={size === 'full' ? 'md:col-span-4 md:row-span-2' : 'md:col-span-2 md:row-span-1'}
Expand All @@ -15,7 +23,7 @@ function ThreeItemGridItem({ item, size }: { item: Product; size: 'full' | 'half
sizes={
size === 'full' ? '(min-width: 768px) 66vw, 100vw' : '(min-width: 768px) 33vw, 100vw'
}
priority={true}
priority={priority}
alt={item.title}
label={{
position: size === 'full' ? 'center' : 'bottom',
Expand All @@ -41,8 +49,8 @@ export async function ThreeItemGrid() {

return (
<section className="mx-auto grid max-w-screen-2xl gap-4 px-4 pb-4 md:grid-cols-6 md:grid-rows-2">
<ThreeItemGridItem size="full" item={firstProduct} />
<ThreeItemGridItem size="half" item={secondProduct} />
<ThreeItemGridItem size="full" item={firstProduct} priority={true} />
<ThreeItemGridItem size="half" item={secondProduct} priority={true} />
<ThreeItemGridItem size="half" item={thirdProduct} />
</section>
);
Expand Down

0 comments on commit e1454d3

Please sign in to comment.