Skip to content

Conversation

@corwintines
Copy link
Member

Description

  • refactors ButtonLink to Button with download function
  • Directly downloads both SVG, PNG, or JPEG files instead of opening image in new tab

@netlify
Copy link

netlify bot commented Nov 15, 2025

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 54a207d
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/6918a28855dea100087071f6
😎 Deploy Preview https://deploy-preview-16657--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 48 (🔴 down 5 from production)
Accessibility: 94 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 92 (no change from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

@corwintines shared an idea that might simplify the implementation and provide a more suitable solution for this case.

matomoHandler()

try {
const response = await fetch(url)
Copy link
Member

Choose a reason for hiding this comment

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

Given that these are same-origin files, we can use the download attr in the links instead of doing this complex workaround, we don't need to fetch the file.

<ButtonLink href={imgSrc} onClick={matomoHandler} download={`${title.replace(/\s+/g, "-").toLowerCase()}.${fileExtension}`}>

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.

3 participants