mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 14:06:59 +00:00
home: style products grid layout
This commit is contained in:
parent
83ac1a8356
commit
25a4ee6dc0
@ -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 }} />
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user