mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-17 07:26:46 +00:00
加入新的打赏码;
文章详情页重新排班; 文章卡牌动画调整;
This commit is contained in:
@@ -8,7 +8,7 @@ import throttle from 'lodash.throttle'
|
||||
*/
|
||||
const Progress = ({ targetRef }) => {
|
||||
const [percent, changePercent] = useState(0)
|
||||
const scrollListener = useCallback(throttle(() => {
|
||||
const scrollListener = () => {
|
||||
if (targetRef.current) {
|
||||
const clientHeight = targetRef ? (targetRef.current.clientHeight) : 0
|
||||
const scrollY = window.pageYOffset
|
||||
@@ -17,7 +17,7 @@ const Progress = ({ targetRef }) => {
|
||||
if (per > 100) per = 100
|
||||
changePercent(per)
|
||||
}
|
||||
}, 100))
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
document.addEventListener('scroll', scrollListener)
|
||||
|
||||
Reference in New Issue
Block a user