Skip to content

Commit

Permalink
Merge pull request #1793 from iFixit/vulcan-fix-linkcard-images
Browse files Browse the repository at this point in the history
Vulcan: fix missing linkcard images
  • Loading branch information
aburke07 authored Jun 30, 2023
2 parents 371635b + f14fbb8 commit 004a281
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion frontend/templates/troubleshooting/Resource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ export function ProductResource({ product }: { product: Product }) {
<Resource
href={productUrl}
title={product.title}
imageUrl={selectedVariant.image?.url}
imageUrl={
selectedVariant.image?.url ||
product.images[0]?.thumbnailUrl ||
product.images[0]?.url
}
spacing="4px"
showBuyButton={isForSale}
openInNewTab={true}
Expand Down
12 changes: 10 additions & 2 deletions frontend/templates/troubleshooting/solution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,20 @@ function LinkCards({
products,
...props
}: { guides: Guide[]; products: Product[] } & BoxProps) {
const uniqueGuides = guides.filter(
(guide, index) =>
guides.findIndex((g) => g.guideid === guide.guideid) === index
);
const uniqueProducts = products.filter(
(product, index) =>
products.findIndex((p) => p.id === product.id) === index
);
return (
<VStack spacing="6px" {...props}>
{guides.map((guide: Guide) => (
{uniqueGuides.map((guide: Guide) => (
<GuideResource key={guide.guideid} guide={guide} />
))}
{products.map((product: Product) => (
{uniqueProducts.map((product: Product) => (
<ProductResource key={product.id} product={product} />
))}
</VStack>
Expand Down

2 comments on commit 004a281

@vercel
Copy link

@vercel vercel bot commented on 004a281 Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

react-commerce – ./frontend

react-commerce.vercel.app
react-commerce-git-main-ifixit.vercel.app
react-commerce-ifixit.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 004a281 Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

react-commerce-prod – ./frontend

react-commerce-prod-ifixit.vercel.app
react-commerce-prod-git-main-ifixit.vercel.app
react-commerce-prod.vercel.app

Please sign in to comment.