Skip to content

Commit

Permalink
Merge pull request timlrx#440 from timlrx/fix/scroll
Browse files Browse the repository at this point in the history
fix: remove smoothscroll-polyfill
  • Loading branch information
timlrx authored Apr 22, 2022
2 parents 3e9116b + 0c46069 commit 5f8dd94
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
4 changes: 1 addition & 3 deletions components/ScrollTopAndComment.js
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -17,7 +15,7 @@ const ScrollTopAndComment = () => {
}, [])

const handleScrollTop = () => {
window.scrollTo({ top: 0, behavior: 'smooth' })
window.scrollTo({ top: 0 })
}
const handleScrollToComment = () => {
document.getElementById('comment').scrollIntoView()
Expand Down
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit 5f8dd94

Please sign in to comment.