feat: add Export to PDF action on public profile page (#2604) - #3495
feat: add Export to PDF action on public profile page (#2604)#3495aaniya22 wants to merge 1 commit into
Conversation
…-coder#2604) Signed-off-by: aaniya22 <aaniyaatomar@gmail.com>
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
|
The 2 failing tests (in |
|
This PR has been inactive for 21 days. If it is still in progress, please leave an update — otherwise it will be closed in 7 days. |
closes #2604
Summary
Adds a "Print Profile / Export to PDF" action on the public profile page. Clicking the button triggers the browser's native
window.print(), with@media printCSS overrides that hide navigation, share, and footer elements so the printed output shows a clean, card-based metrics layout.Closes #2604
Type of Change
What Changed
src/components/ExportPdfButton.tsx— client button that triggerswindow.print()ExportPdfButtonintosrc/app/u/[username]/page.tsx, placed alongside the compare buttonsprint:hiddento the Share section, Powered-by-DevTrack footer, and other non-essential UI so they're excluded from the printed/PDF output@media printrules insrc/app/globals.cssto strip shadows, flatten borders on card elements (.surface-card,[class*="rounded-2xl"]), and prevent cards from breaking across pagesHow to Test
/u/<username>Expected result: A clean, print-ready view of the profile stats with no interactive UI elements, matching the layout described in the issue.
Checklist
console.log, debug code, or commented-out blocksnpm run lintpasses locallynpm run type-check)Accessibility (UI changes only)
Additional Context
No external dependencies added — uses native
window.print()and CSS@media printper the issue's acceptance criteria.