fix: remove smoothscroll-polyfill

This commit is contained in:
Timothy Lin
2022-04-22 16:45:30 -07:00
parent 3e9116b888
commit 0c4606916f
3 changed files with 1 additions and 9 deletions

View File

@ -1,12 +1,10 @@
import siteMetadata from '@/data/siteMetadata'
import { useEffect, useState } from 'react'
import smoothscroll from 'smoothscroll-polyfill'
const ScrollTopAndComment = () => {
const [show, setShow] = useState(false)
useEffect(() => {
smoothscroll.polyfill()
const handleWindowScroll = () => {
if (window.scrollY > 50) setShow(true)
else setShow(false)
@ -17,7 +15,7 @@ const ScrollTopAndComment = () => {
}, [])
const handleScrollTop = () => {
window.scrollTo({ top: 0, behavior: 'smooth' })
window.scrollTo({ top: 0 })
}
const handleScrollToComment = () => {
document.getElementById('comment').scrollIntoView()