From 6ff2e45d8e5a0d3aeee658c038257d29877d2db1 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Fri, 6 Nov 2020 13:58:16 -0300 Subject: [PATCH] Temporary remove scoll event --- components/common/Layout/Layout.tsx | 30 ++++++++++++++--------------- pages/index.tsx | 5 ++--- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/components/common/Layout/Layout.tsx b/components/common/Layout/Layout.tsx index 373007cb6..a60e06203 100644 --- a/components/common/Layout/Layout.tsx +++ b/components/common/Layout/Layout.tsx @@ -37,23 +37,23 @@ const Layout: FC = ({ children, pageProps }) => { isDisabled: !(displaySidebar || displayModal), }) - const handleScroll = useCallback( - debounce(() => { - const offset = 0 - const { scrollTop } = document.documentElement - const scrolled = scrollTop > offset + // const handleScroll = useCallback( + // debounce(() => { + // const offset = 0 + // const { scrollTop } = document.documentElement + // const scrolled = scrollTop > offset - setHasScrolled(scrolled) - }, 1), - [] - ) + // setHasScrolled(scrolled) + // }, 1), + // [] + // ) - useEffect(() => { - document.addEventListener('scroll', handleScroll) - return () => { - document.removeEventListener('scroll', handleScroll) - } - }, [handleScroll]) + // useEffect(() => { + // document.addEventListener('scroll', handleScroll) + // return () => { + // document.removeEventListener('scroll', handleScroll) + // } + // }, [handleScroll]) return ( diff --git a/pages/index.tsx b/pages/index.tsx index 027e519b1..c410d6051 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -83,7 +83,6 @@ export default function Home({ categories, newestProducts, }: InferGetStaticPropsType) { - console.log('x') return (
@@ -98,7 +97,7 @@ export default function Home({ /> ))} - + {/* {bestSelling.slice(3, 6).map(({ node }) => ( + /> */} ) }