From a387e0aee287b5f6754b23040842425d1515a909 Mon Sep 17 00:00:00 2001 From: strawberries73 <39388566+strawberries73@users.noreply.github.com> Date: Tue, 24 Nov 2020 00:07:24 -0500 Subject: [PATCH 1/3] Changed function name to LoadAutoScroll --- src/frontend/src/components/Posts/LoadAutoScroll.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/components/Posts/LoadAutoScroll.jsx b/src/frontend/src/components/Posts/LoadAutoScroll.jsx index 54e8a8904c..0fec19e477 100644 --- a/src/frontend/src/components/Posts/LoadAutoScroll.jsx +++ b/src/frontend/src/components/Posts/LoadAutoScroll.jsx @@ -13,7 +13,7 @@ const useStyles = makeStyles((theme) => ({ }, })); -function LoadMoreButton({ onScroll }) { +function LoadAutoScroll({ onScroll }) { const classes = useStyles(); const $buttonRef = useRef(null); @@ -51,8 +51,8 @@ function LoadMoreButton({ onScroll }) { ); } -LoadMoreButton.propTypes = { +LoadAutoScroll.propTypes = { onClick: PropTypes.func, }; -export default LoadMoreButton; +export default LoadAutoScroll; From 36ae2a02811dca9ae9ecced397f267762dae24ae Mon Sep 17 00:00:00 2001 From: strawberries73 <39388566+strawberries73@users.noreply.github.com> Date: Tue, 24 Nov 2020 14:47:09 -0500 Subject: [PATCH 2/3] Changed onScroll to onClick --- src/frontend/src/components/Posts/LoadAutoScroll.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/components/Posts/LoadAutoScroll.jsx b/src/frontend/src/components/Posts/LoadAutoScroll.jsx index 0fec19e477..50059189e7 100644 --- a/src/frontend/src/components/Posts/LoadAutoScroll.jsx +++ b/src/frontend/src/components/Posts/LoadAutoScroll.jsx @@ -13,7 +13,7 @@ const useStyles = makeStyles((theme) => ({ }, })); -function LoadAutoScroll({ onScroll }) { +function LoadAutoScroll({ onClick }) { const classes = useStyles(); const $buttonRef = useRef(null); @@ -30,7 +30,7 @@ function LoadAutoScroll({ onScroll }) { (entries) => entries.forEach((entry) => { if (entry.isIntersecting) { - onScroll(); + onClick(); } }), options From d5df2b37053b5078f990d199e387c69466296228 Mon Sep 17 00:00:00 2001 From: strawberries73 <39388566+strawberries73@users.noreply.github.com> Date: Tue, 24 Nov 2020 15:49:34 -0500 Subject: [PATCH 3/3] Changed onClick back to onScroll --- src/frontend/src/components/Posts/LoadAutoScroll.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/components/Posts/LoadAutoScroll.jsx b/src/frontend/src/components/Posts/LoadAutoScroll.jsx index 50059189e7..946f4ddfc8 100644 --- a/src/frontend/src/components/Posts/LoadAutoScroll.jsx +++ b/src/frontend/src/components/Posts/LoadAutoScroll.jsx @@ -13,7 +13,7 @@ const useStyles = makeStyles((theme) => ({ }, })); -function LoadAutoScroll({ onClick }) { +function LoadAutoScroll({ onScroll }) { const classes = useStyles(); const $buttonRef = useRef(null); @@ -30,7 +30,7 @@ function LoadAutoScroll({ onClick }) { (entries) => entries.forEach((entry) => { if (entry.isIntersecting) { - onClick(); + onScroll(); } }), options @@ -53,6 +53,7 @@ function LoadAutoScroll({ onClick }) { LoadAutoScroll.propTypes = { onClick: PropTypes.func, + onScroll: PropTypes.func, }; export default LoadAutoScroll;