Skip to content

ECHOES-1188 Allow custom icon (or no icon) for DropdownMenu.ItemLinkDownload#668

Merged
david-cho-lerat-sonarsource merged 1 commit intomainfrom
david/ECHOES-1188-custom-icon-for-download-link
Apr 14, 2026
Merged

ECHOES-1188 Allow custom icon (or no icon) for DropdownMenu.ItemLinkDownload#668
david-cho-lerat-sonarsource merged 1 commit intomainfrom
david/ECHOES-1188-custom-icon-for-download-link

Conversation

@david-cho-lerat-sonarsource
Copy link
Copy Markdown
Contributor

No description provided.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 14, 2026

Deploy Preview for echoes-react ready!

Name Link
🔨 Latest commit b027107
🔍 Latest deploy log https://app.netlify.com/projects/echoes-react/deploys/69de0c34c874020008829068
😎 Deploy Preview https://deploy-preview-668--echoes-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod Bot commented Apr 14, 2026

ECHOES-1188

@sonar-review-alpha
Copy link
Copy Markdown

sonar-review-alpha Bot commented Apr 14, 2026

Summary

This PR makes the download icon in DropdownMenu.ItemLinkDownload customizable. Previously the component always rendered with a hardcoded download icon. Now consumers can:

  • Accept the default download icon (current behavior)
  • Provide a custom icon via the prefix prop
  • Render with no icon by passing prefix={undefined}

The implementation removes 'prefix' from the prop omission list and uses a conditional to apply the default icon only when prefix isn't explicitly provided.

What reviewers should know

Key changes:

  • DropdownMenuItemLinkDownloadProps type: prefix moved from omitted props to accepted props
  • Component logic: Now checks if prefix exists in props; uses default IconDownload if not provided
  • Test coverage: New test validates all three scenarios (default icon, custom icon, no icon)
  • Storybook: Two new stories demonstrate the customization options

For reviewers:
Start with DropdownMenuItemLinkDownload.tsx (the logic is straightforward). The test comprehensively covers the feature. The Storybook stories provide visual reference for the new behavior. Note that passing prefix={undefined} explicitly removes the icon—this is intentional and tested.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

@sonarqube-next
Copy link
Copy Markdown

Copy link
Copy Markdown

@sonar-review-alpha sonar-review-alpha Bot left a comment

Choose a reason for hiding this comment

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

LGTM! ✅

Clean, minimal change. The 'prefix' in props check is the correct idiom for distinguishing "prop not passed" from "prop explicitly set to undefined", and the spread-then-override pattern in the JSX is safe. Test coverage is thorough across all three cases.

🗣️ Give feedback

Copy link
Copy Markdown
Contributor

@jeremy-davis-sonarsource jeremy-davis-sonarsource left a comment

Choose a reason for hiding this comment

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

Noice

@david-cho-lerat-sonarsource david-cho-lerat-sonarsource merged commit c44443b into main Apr 14, 2026
14 checks passed
@david-cho-lerat-sonarsource david-cho-lerat-sonarsource deleted the david/ECHOES-1188-custom-icon-for-download-link branch April 14, 2026 12:59
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.

2 participants