From 26547d8e9706867141e653d826e8e76680540d82 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 9 Mar 2023 11:54:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DNext=E4=B8=BB=E9=A2=98bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/next/components/JumpToBottomButton.js | 8 ++++---- themes/next/components/JumpToTopButton.js | 2 +- themes/next/components/SideAreaRight.js | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/themes/next/components/JumpToBottomButton.js b/themes/next/components/JumpToBottomButton.js index 8da40c86..c54b7b59 100644 --- a/themes/next/components/JumpToBottomButton.js +++ b/themes/next/components/JumpToBottomButton.js @@ -18,10 +18,6 @@ const JumpToBottomButton = ({ showPercent = false }) => { return () => document.removeEventListener('scroll', scrollListener) }, [show]) - if (!CONFIG_NEXT.WIDGET_TO_BOTTOM) { - return <> - } - const scrollListener = () => { const targetRef = document.getElementById('wrapper') const clientHeight = targetRef?.clientHeight @@ -41,6 +37,10 @@ const JumpToBottomButton = ({ showPercent = false }) => { window.scrollTo({ top: targetRef.clientHeight, behavior: 'smooth' }) } + if (!CONFIG_NEXT.WIDGET_TO_BOTTOM) { + return <> + } + return (
diff --git a/themes/next/components/JumpToTopButton.js b/themes/next/components/JumpToTopButton.js index ce7685a1..9ff51635 100644 --- a/themes/next/components/JumpToTopButton.js +++ b/themes/next/components/JumpToTopButton.js @@ -11,10 +11,10 @@ import CONFIG_NEXT from '../config_next' * @constructor */ const JumpToTopButton = ({ showPercent = true, percent }) => { + const { locale } = useGlobal() if (!CONFIG_NEXT.WIDGET_TO_TOP) { return <> } - const { locale } = useGlobal() return (
window.scrollTo({ top: 0, behavior: 'smooth' })} >
diff --git a/themes/next/components/SideAreaRight.js b/themes/next/components/SideAreaRight.js index 26372663..915316b2 100644 --- a/themes/next/components/SideAreaRight.js +++ b/themes/next/components/SideAreaRight.js @@ -22,7 +22,7 @@ const NextRecentComments = dynamic(() => import('./NextRecentComments')) * @constructor */ const SideAreaRight = (props) => { - const { tags, currentTag, slot, categories, currentCategory, notice } = props + const { tagOptions, currentTag, slot, categoryOptions, currentCategory, notice } = props const { locale } = useGlobal() const router = useRouter() return (