forked from crowetic/commerce
Temporary remove scoll event
This commit is contained in:
parent
0aaeafca56
commit
6ff2e45d8e
@ -37,23 +37,23 @@ const Layout: FC<Props> = ({ children, pageProps }) => {
|
|||||||
isDisabled: !(displaySidebar || displayModal),
|
isDisabled: !(displaySidebar || displayModal),
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleScroll = useCallback(
|
// const handleScroll = useCallback(
|
||||||
debounce(() => {
|
// debounce(() => {
|
||||||
const offset = 0
|
// const offset = 0
|
||||||
const { scrollTop } = document.documentElement
|
// const { scrollTop } = document.documentElement
|
||||||
const scrolled = scrollTop > offset
|
// const scrolled = scrollTop > offset
|
||||||
|
|
||||||
setHasScrolled(scrolled)
|
// setHasScrolled(scrolled)
|
||||||
}, 1),
|
// }, 1),
|
||||||
[]
|
// []
|
||||||
)
|
// )
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
document.addEventListener('scroll', handleScroll)
|
// document.addEventListener('scroll', handleScroll)
|
||||||
return () => {
|
// return () => {
|
||||||
document.removeEventListener('scroll', handleScroll)
|
// document.removeEventListener('scroll', handleScroll)
|
||||||
}
|
// }
|
||||||
}, [handleScroll])
|
// }, [handleScroll])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CommerceProvider locale={locale}>
|
<CommerceProvider locale={locale}>
|
||||||
|
@ -83,7 +83,6 @@ export default function Home({
|
|||||||
categories,
|
categories,
|
||||||
newestProducts,
|
newestProducts,
|
||||||
}: InferGetStaticPropsType<typeof getStaticProps>) {
|
}: InferGetStaticPropsType<typeof getStaticProps>) {
|
||||||
console.log('x')
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Grid>
|
<Grid>
|
||||||
@ -98,7 +97,7 @@ export default function Home({
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Grid>
|
</Grid>
|
||||||
<Marquee variant="secondary">
|
{/* <Marquee variant="secondary">
|
||||||
{bestSelling.slice(3, 6).map(({ node }) => (
|
{bestSelling.slice(3, 6).map(({ node }) => (
|
||||||
<ProductCard
|
<ProductCard
|
||||||
key={node.path}
|
key={node.path}
|
||||||
@ -147,7 +146,7 @@ export default function Home({
|
|||||||
categories={categories}
|
categories={categories}
|
||||||
brands={brands}
|
brands={brands}
|
||||||
newestProducts={newestProducts}
|
newestProducts={newestProducts}
|
||||||
/>
|
/> */}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user