feat: Add reusable Back to Top button for improved navigation [Issue: #326]#389
Conversation
|
@abdullahxyz85 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 check it now, I close the older PR and create new PRs by spliting from each others, please review and merge and make sure to add the labels, gssoc:approved and level. |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
One bug in the SVG arrow direction:
Bug: Arrow points DOWN, not UP
The base SVG path M7 16l-4-4m0 0l4-4m-4 4h18 draws a left-pointing arrow (←). Applying rotate(90 12 12) rotates it 90° clockwise → down arrow (↓). For a 'scroll to top' button you need an UP arrow.
Fix: change rotate(90 12 12) to rotate(-90 12 12) (or use rotate(270 12 12)). Or replace the path with one that's inherently upward:
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 15l7-7 7 7" />Everything else looks correct — CSS vars, aria-label, focus:ring, cleanup on unmount.
Just need to do this right , other things are ok? @Priyanshu-byte-coder |
I fix it please review and merge the PR , with gssoc label: gssoc:approved and level. |
|
@Priyanshu-byte-coder Done! Please make sure to add the label: gssoc:approved and level:adavanced. |
|
@Priyanshu-byte-coder Please review my PRs: #389 , #390 , #392 , #393 , I fix all the things in these that u said me and please review and merge these so that i can work on my other assign issues, and make sure to add the label: gssoc:approved and level: advanced/critical |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Clean implementation. Correct CSS var usage throughout, proper SSR guards, rel="noopener noreferrer" on links. The typeof window !== 'undefined' checks are unnecessary in a "use client" component but harmless. Merging.
333437e
into
Priyanshu-byte-coder:main

Summary [Issue: #326 ]
Implements a floating "Back to Top" button that improves user experience by providing quick navigation to the top of long pages. The button appears after scrolling down and smoothly scrolls users back to the top when clicked.
Motivation
Users need to manually scroll back to the top after navigating through long sections/pages. A floating Back to Top button enhances navigation and improves overall user experience, particularly on long dashboard pages.
What's Changed
New Component
src/components/BackToTopButton.tsx- Reusable floating button component with:Integration
src/app/providers.tsx- Added BackToTopButton to root Providers component so it appears on all pagesImplementation Details
Features
✅ Floating Button
✅ Scroll Detection
✅ Smooth Scrolling
scroll-behavior: smoothVisual Overview:
Checklist
npx tsc --noEmit)Closes: #326