build React.

This commit is contained in:
tangly1024.com
2023-11-06 14:20:43 +08:00
parent 0a6c59ed7b
commit ecf7825dad
117 changed files with 121 additions and 206 deletions

View File

@@ -1,5 +1,5 @@
import { useGlobal } from '@/lib/global'
import React from 'react'
import { useEffect, useState } from 'react'
/**
* 跳转到网页顶部
@@ -11,7 +11,7 @@ import React from 'react'
*/
const JumpToTopButton = () => {
const { locale } = useGlobal()
const [show, switchShow] = React.useState(false)
const [show, switchShow] = useState(false)
const scrollListener = () => {
const scrollY = window.pageYOffset
const shouldShow = scrollY > 200
@@ -20,7 +20,7 @@ const JumpToTopButton = () => {
}
}
React.useEffect(() => {
useEffect(() => {
document.addEventListener('scroll', scrollListener)
return () => document.removeEventListener('scroll', scrollListener)
}, [show])