shyamtawli / devFind

devFind is an open source project that aims to create a platform for developers to showcase their skills and connect with potential collaborators, all in a user-friendly and searchable format.
https://dev-find.vercel.app/
MIT License
551 stars 588 forks source link

Scroll-to-Top button #1132

Open elijahlowe77 opened 1 month ago

elijahlowe77 commented 1 month ago

Description

' added new component and folder PageUp that creates a button when clicked scrolls to top of page, placed over next page button. Also added profile ## Related Issues

i used code sandbox, so the css elements did not load correctly in preview window for screenshots Screenshot 2024-10-02 175720 Screenshot 2024-10-03 220946 Screenshot 2024-10-03 221012

Changes Proposed

Checklist

Screenshots

Note to reviewers

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dev-find ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2024 2:43am
dylan-dot-c commented 1 month ago

The button is not working.

You might need to use a ref and scroll to top like how its done in the app.js file

useEffect(() => {
    profilesRef.current.scrollTo({
      top: 0,
      behavior: 'smooth',
    });
  }, [currentPage]);

seeing that its already in the same file, you could take profilesRef as a prop and write that method when your button is clicked(redundant code) or you could turn this into a function and then take that function as a prop and simply run that function when your button is clicked.

Also... please make an issue first before making your PR, we could have had a discussion and whether this was needed and the best location for it to be placed.

P.S. not too sure about the design, looks plain and we already have 2 buttons there. Also the button text is kinda vague.