-
Notifications
You must be signed in to change notification settings - Fork 42
[Appdir] Thumbnail recoloring #3776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…metOverview.module.css
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the thumbnail rendering by recoloring images based on status, migrating from NextImage and custom SVG fallbacks to a new utility component, ImageAsThemedSvg.
- Replaces NextImage with ImageAsThemedSvg in DesignsystemetOverviewCard
- Updates DesignsystemetPage and DesignsystemetThumbnail to use the new thumbnail URL and rendering logic
- Introduces a new utility component for fetching and sanitizing SVG images with dynamic color replacements
Reviewed Changes
Copilot reviewed 4 out of 7 changed files in this pull request and generated no comments.
File | Description |
---|---|
aksel.nav.no/website/app/dev/(designsystemet)/_ui/overview/DesignsystemetOverview.tsx | Replaces NextImage/FallbackSvg with ImageAsThemedSvg and re-arranges layout for status tag positioning |
aksel.nav.no/website/app/dev/(designsystemet)/_ui/DesignsystemetPage.tsx | Passes thumbnailUrl to DesignsystemetThumbnail and adds data attributes for styling |
aksel.nav.no/website/app/dev/(designsystemet)/_ui/Designsystemet.thumbnail.tsx | Refactors thumbnail component to conditionally render SVG based on thumbnailUrl |
aksel.nav.no/website/app/_ui/image-as-svg/ImageAsSvg.tsx | Adds a new async component for fetching, recoloring, and sanitizing SVG images using DOMPurify |
Files not reviewed (3)
- aksel.nav.no/website/app/_ui/image-as-svg/ImageAsSvg.module.css: Language not supported
- aksel.nav.no/website/app/dev/(designsystemet)/_ui/Designsystemet.module.css: Language not supported
- aksel.nav.no/website/app/dev/(designsystemet)/_ui/overview/DesignsystemetOverview.module.css: Language not supported
Comments suppressed due to low confidence (1)
aksel.nav.no/website/app/_ui/image-as-svg/ImageAsSvg.tsx:7
- The async component ImageAsThemedSvg is used directly within JSX in other components. Please ensure that its asynchronous behavior is properly handled by its consumers (e.g., by using server components or Suspense) to prevent potential rendering issues.
async function ImageAsThemedSvg({
Description
Colors thumbnail based on status


Component Checklist 📝
@navikt/core/css/config/_mappings.js
)@navikt/core/css/tokens.json
)@navikt/aksel-stylelint/src/deprecations.ts
)@navikt/core/react/src/index.ts
and@navikt/core/react/package.json
)@navikt/core/css/index.css
)<Component>: <gitmoji?> <Text>.
E.g. "Button: ✨ Add feature xyz.")