Repository navigation
feat(profile): add "Get README Badge" dialog with Markdown/HTML copy - #223
Conversation
|
@1-DARK is attempting to deploy a commit to the osama's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for the pull request! ✅ A maintainer will review this soon. Please be patient while we take a look. 🙌 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
O2sa
left a comment
There was a problem hiding this comment.
A couple of small changes I'd suggest before merging:
-
Remove the
badgeCopiedlogic — currentlybadgeCopiedis never updated because thecopyfunction isn't used for it, so thebadgeCopiedstate can never becometrue. Since the Markdown and HTML copy states are already handled separately, this extra state isn't needed. -
Use an environment variable for the profile URL instead of
window.location.origin. Since this URL will be copied into users' README files and should be a permanent/canonical link, relying on the current origin could generate links to preview or other deployment environments. I'd suggest using something likeNEXT_PUBLIC_SITE_URLfor the canonical DevImpact URL.
Other than these, the feature looks good.
|
🎊 Welcome, @1-DARK! Your first contribution has been merged! 🚀 Thank you for helping improve the project! If you find this tool useful, please consider giving us a ⭐ star on GitHub—it helps more developers find our work and motivates us to keep improving! |
Summary
Adds a Get README Badge button to the developer profile page (
/user/[username]). It opens a modal where developers can preview their DevImpact score badge and copy a ready-to-use snippet for their GitHub profile README. Every embedded badge links back to the user's DevImpact profile, which creates a backlink to the project.Closes #219
What changed
UserProfileClient, next to Compare and Copy link.flat,flat-squareand score color (red, orange, yellow, green or bright green, depending on the score).role="dialog"andaria-modal.[](profile-url)<a href="profile-url"><img src="badge-url" alt="DevImpact Score" /></a>lginstead ofsm, so the action buttons no longer get squeezed.profile.*keys added toen.jsonandar.json. Snippet inputs usedir="ltr"so URLs display correctly in RTL.Files changed
src/features/developer/components/user-profile-client.tsxsrc/locales/en.jsonsrc/locales/ar.jsonNotes for reviewers
window.location.origin, so no new environment variable is needed. If you prefer a fixed production URL, I can switch it to a constant or env var./api/badge/[username]endpoint with the Shields endpoint format.img-srcmust allowhttps://img.shields.io.Screenshots
Testing
npm run lintpassesnpm run buildpassesChecklist