Merge pull request #440 from timlrx/fix/scroll

fix: remove smoothscroll-polyfill
This commit is contained in:
Timothy 2022-04-22 16:48:28 -07:00 committed by GitHub
commit 5f8dd94e43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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()

5
package-lock.json generated
View File

@ -9405,11 +9405,6 @@
}
}
},
"smoothscroll-polyfill": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/smoothscroll-polyfill/-/smoothscroll-polyfill-0.4.4.tgz",
"integrity": "sha512-TK5ZA9U5RqCwMpfoMq/l1mrH0JAR7y7KRvOBx0n2869aLxch+gT9GhN3yUfjiw+d/DiF1mKo14+hd62JyMmoBg=="
},
"socket.io": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.4.0.tgz",

View File

@ -39,7 +39,6 @@
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"sharp": "^0.28.3",
"smoothscroll-polyfill": "^0.4.4",
"tailwindcss": "^3.0.23",
"unist-util-visit": "^4.0.0"
},