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

Issue #1410 Changed function name to LoadAutoScroll #1453

Merged
merged 3 commits into from
Nov 24, 2020

Conversation

strawberries73
Copy link
Contributor

@strawberries73 strawberries73 commented Nov 24, 2020

Issue This PR Addresses

Fixes #1410

Type of Change

  • Bugfix: Change which fixes an issue
  • New Feature: Change which adds functionality
  • Documentation Update: Change which improves documentation
  • UI: Change which improves UI

Description

Changed the function name from LoadMoreButton to LoadAutoScroll
Changed onScroll to onClick

Checklist

  • Quality: This PR builds and passes our npm test and works locally
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not (if applicable)
  • Documentation: This PR includes updated/added documentation to user exposed functionality or configuration variables are added/changed or an explanation of why it does not(if applicable)

@strawberries73
Copy link
Contributor Author

@klee214 I noticed that there is an error at onScroll on line 16. Would you like me to add it to props validation and start the PR again?
image

Copy link
Contributor

@klee214 klee214 left a comment

Choose a reason for hiding this comment

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

Sorry I didn't notice that please change the Line 55 OnClick -----> OnScroll. Also you might need to change the parent component if it use onClick instead of onScroll

@strawberries73
Copy link
Contributor Author

@klee214 I changed the onScroll to onClick.

@@ -13,7 +13,7 @@ const useStyles = makeStyles((theme) => ({
},
}));

function LoadMoreButton({ onScroll }) {
function LoadAutoScroll({ onClick }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Other way around, this prop needs to be onScroll and below on the propTypes you need onScroll too. You can see how it's called at

<LoadAutoScroll onScroll={() => nextPage()} key={`load-more-button-${pages.length}`} />
, which is sending an onScroll function.

@humphd humphd merged commit a1b234c into Seneca-CDOT:master Nov 24, 2020
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.

Wrong function name in src/frontend/src/components/Posts/LoadAutoScroll.jsx
4 participants