feat(dashboard): 3.0 product collection (#6120)

This commit is contained in:
Kasper Fabricius Kristensen
2024-01-18 15:01:34 +01:00
committed by GitHub
parent b132ff7669
commit e49b6944e3
70 changed files with 2787 additions and 752 deletions
@@ -0,0 +1,24 @@
import { useRef, useState } from "react"
export const useHandleTableScroll = () => {
const tableContainerRef = useRef<HTMLDivElement>(null)
// Listen for if the table container that has overflow-y: auto is scrolled, and if true set some state
const [isScrolled, setIsScrolled] = useState(false)
const handleScroll = () => {
if (tableContainerRef.current) {
setIsScrolled(
tableContainerRef.current.scrollTop > 0 &&
tableContainerRef.current.scrollTop <
tableContainerRef.current.scrollHeight
)
}
}
return {
tableContainerRef,
isScrolled,
handleScroll,
}
}