编译修复
This commit is contained in:
tangly1024
2021-12-17 14:53:18 +08:00
parent f154f24f88
commit 636d355234
5 changed files with 0 additions and 13 deletions

View File

@@ -3,14 +3,12 @@ import { loadUserThemeFromCookies, saveTheme, useGlobal } from '@/lib/global'
import { faMoon, faSun } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
let windowTop = 0
export default function FloatDarkModeButton () {
const [show, switchShow] = useState(false)
const scrollListener = () => {
const scrollY = window.pageYOffset
// const shouldShow = scrollY > 100 && scrollY < windowTop
const shouldShow = scrollY > 100
windowTop = scrollY
if (shouldShow !== show) {
switchShow(shouldShow)
}