home: style products grid layout

This commit is contained in:
andr-ew 2023-07-12 22:47:11 -05:00
parent 83ac1a8356
commit 25a4ee6dc0
2 changed files with 8 additions and 9 deletions

View File

@ -37,20 +37,12 @@ export async function HomeProductsList({ collection }) {
collection, collection,
}); });
// console.log({ collection, products });
// const num = 4;
// console.log({
// price: products[num].priceRange,
// compareAt: products[num].compareAtPriceRange,
// title: products[num].title,
// });
return ( return (
<> <>
{products.length === 0 ? ( {products.length === 0 ? (
<p>{`No products found`}</p> <p>{`No products found`}</p>
) : ( ) : (
<ul> <ul className={styles.homeProductsList}>
{products?.map(product => ( {products?.map(product => (
<li key={product?.handle}> <li key={product?.handle}>
<HomeProduct {...{ product }} /> <HomeProduct {...{ product }} />

View File

@ -29,3 +29,10 @@
@include typography.body-cta; @include typography.body-cta;
} }
} }
.homeProductsList {
display: grid;
grid-template-columns: repeat(3, 1fr);
column-gap: 10px;
row-gap: 20px;
}