import { ArrowUpIcon } from '@heroicons/react/solid' import clsx from 'clsx' import { useEffect, useState } from 'react' import { Row } from './layout/row' export function ScrollToTopButton(props: { className?: string }) { const { className } = props const [visible, setVisible] = useState(false) useEffect(() => { window.addEventListener('scroll', () => { if (window.scrollY > 500) { console.log('button commence') setVisible(true) } else { setVisible(false) } }) }, []) const scrollToTop = () => { window.scrollTo({ top: 0, behavior: 'smooth', }) } return ( ) }