Skip to content

feat: Add Copy profile url link button#372

Closed
0411-bokilshruti wants to merge 2 commits into
Priyanshu-byte-coder:mainfrom
0411-bokilshruti:feat/issue-192-add-copy-profile-URL-button
Closed

feat: Add Copy profile url link button#372
0411-bokilshruti wants to merge 2 commits into
Priyanshu-byte-coder:mainfrom
0411-bokilshruti:feat/issue-192-add-copy-profile-URL-button

Conversation

@0411-bokilshruti
Copy link
Copy Markdown
Contributor

Summary

Added a CopyLinkButton client component that copies the public profile URL to clipboard on click, with a 2-second "✓ Copied!" visual feedback. Button is placed in the profile page header next to the username.

Closes #192

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup

Changes Made

  • Created src/components/CopyLinkButton.tsx as a 'use client' component.
  • Added clipboard copy functionality using navigator.clipboard.writeText(window.location.href).
  • Button text changes to ✓ Copied! for 2 seconds after clicking.
  • Added aria-label="Copy profile link" for accessibility.
  • Imported and placed CopyLinkButton in src/app/u/[username]/page.tsx next to the username.

How to Test

Steps for the reviewer to verify this works:

  1. Navigate to any public profile page /u/[username]
  2. Click the 🔗 Copy link button
  3. Paste anywhere to verify the correct profile URL was copied
  4. Verify button shows ✓ Copied! for 2 seconds then resets

Screenshots (if UI change)

image image

Checklist

  • Linked issue in summary
  • npm run lint passes locally
  • No TypeScript errors (npm run type-check)
  • Self-reviewed the diff
  • Added/updated tests if applicable

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

@0411-bokilshruti is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

Two issues:

1. Copies the wrong URL

CopyLinkButton is placed in DashboardHeader.tsx and copies window.location.href — which is the dashboard URL (/dashboard), not the public profile URL. Issue #192 is about the public profile page (/u/username).

Either:

  • Move the button to src/app/u/[username]/page.tsx (the public profile page), where window.location.href is already the profile URL, or
  • Keep it in the dashboard header but copy ${window.location.origin}/u/${session.githubLogin} using the session login

2. tsconfig.json change already merged

jsx: "react-jsx" → "preserve" was already merged via PR #358. This will cause a merge conflict. Remove the tsconfig change from this PR.

@0411-bokilshruti
Copy link
Copy Markdown
Contributor Author

Hey @Priyanshu-byte-coder, I've addressed both the issues. The button now copies the correct public profile URL using session?.githubLogin. Please take a look when you get a chance.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

Closing in favor of PR #269 which correctly places the copy link button on the public profile page (/u/[username]). Issue #192 asked for the button on the public profile, not the dashboard header. PR #269 has been merged.

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.

[GOOD FIRST ISSUE] Add 'copy profile URL' button to public profile page

2 participants