mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Issue/79 fallback image (#179)
* Filter products from the homepage grid display when they do not have and image. Provide a fallback/placeholder image for the ProductCard for when a product does not have an image. * Avoid repeating placeholder image reference and move to a variable * Remove filter to avoid additional computations as per https://github.com/vercel/commerce/pull/80#discussion_r531142893. Placeholder images will display as fallback. * Filter products from the homepage grid display when they do not have and image. Provide a fallback/placeholder image for the ProductCard for when a product does not have an image. * Avoid repeating placeholder image reference and move to a variable * Remove filter to avoid additional computations as per https://github.com/vercel/commerce/pull/80#discussion_r531142893. Placeholder images will display as fallback. * Remove comment about filter. Code removed so no longer needed. Co-authored-by: B <curciobelen@gmail.com>
This commit is contained in:
@@ -44,6 +44,7 @@ export async function getStaticProps({
|
||||
// We prefer to do the computation at buildtime/servertime
|
||||
const { featured, bestSelling } = (() => {
|
||||
// Create a copy of products that we can mutate
|
||||
// Filter products that do not have images
|
||||
const products = [...newestProducts]
|
||||
// If the lists of featured and best selling products don't have enough
|
||||
// products, then fill them with products from the products list, this
|
||||
|
Reference in New Issue
Block a user