Skip to content

fix(resources): render SVG thumbnails in cards#7711

Open
arjunmehta-git wants to merge 1 commit intomasterfrom
fix/resources-svg-thumbnails
Open

fix(resources): render SVG thumbnails in cards#7711
arjunmehta-git wants to merge 1 commit intomasterfrom
fix/resources-svg-thumbnails

Conversation

@arjunmehta-git
Copy link
Copy Markdown
Contributor

Summary

  • query thumbnail_svg and darkthumbnail_svg for the Resources grid
  • update the shared card component to prefer raster thumbnails and fall back to SVG assets
  • restore missing images for SVG-only resource cards in the Resources listings

Problem

The Resources page requested only raster thumbnail fields, while a set of published resources define only SVG thumbnail metadata. The shared card component also ignored the SVG fields, so those cards rendered without images.

Result

Resources cards now render available SVG thumbnails, including dark-mode variants when present.

Query SVG thumbnail fields for the Resources grid and teach the shared card component to fall back to SVG and dark SVG assets when raster thumbnails are unavailable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Arjun Mehta <231106746+arjunmehta-git@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 17:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR fixes missing thumbnails in the Resources listings by querying SVG thumbnail fields and updating the shared Card component to fall back to SVG assets (including dark-mode variants) when raster thumbnails aren’t available.

Changes:

  • Extend the Resources grid static query to include thumbnail_svg and darkthumbnail_svg.
  • Update the shared Card component to prefer raster thumbnails but fall back to SVG (and use dark variants in dark mode).
  • Avoid rendering the image component when no thumbnail exists.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/sections/Resources/Resources-grid/DataWrapper.js Adds SVG thumbnail fields to the allMdx query used by the Resources grid.
src/components/Card/index.js Implements thumbnail selection logic with SVG and dark-mode fallbacks, and guards image rendering when missing.

Copy link
Copy Markdown
Member

@leecalcote leecalcote left a comment

Choose a reason for hiding this comment

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

Thanks. Let's see what the deploy preview looks like.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🚀 Preview deployment: https://layer5.io/pr-preview/pr-7711/

Note: Preview may take a moment (GitHub Pages deployment in progress). Please wait and refresh. Track deployment here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants