Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll-to-Top button #1132

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

elijahlowe77
Copy link

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

  • [ Yes] I have read and followed the Contribution Guidelines.
  • [ Yes] All new and existing tests passed.
  • [ Yes] I have updated the documentation to reflect the changes I've made.
  • [ Yes] My code follows the code style of this project.
  • [ Yes] The title of my pull request is a short description of the requested changes.

Screenshots

Note to reviewers

Copy link

vercel bot commented Oct 4, 2024

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

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, @elijahlowe77! 🎉 Thank you for opening a pull request. Your contribution is valuable and we appreciate your efforts to improve our project.

Soon the maintainers/owner will review it and provide you with feedback/suggestions.

@dylan-dot-c
Copy link
Contributor

dylan-dot-c commented Oct 4, 2024

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.

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.

2 participants