diff --git a/components/JumpToBottomButton.js b/components/JumpToBottomButton.js index 877233a5..2d7d3417 100644 --- a/components/JumpToBottomButton.js +++ b/components/JumpToBottomButton.js @@ -1,5 +1,4 @@ import BLOG from '@/blog.config' -import { useGlobal } from '@/lib/global' import { faArrowDown } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import React, { useEffect, useState } from 'react' @@ -18,7 +17,6 @@ const JumpToBottomButton = ({ showPercent = false }) => { return <> } - const { locale } = useGlobal() const [show, switchShow] = useState(false) const [percent, changePercent] = useState(0) const scrollListener = () => { @@ -47,12 +45,12 @@ const JumpToBottomButton = ({ showPercent = false }) => { return () => document.removeEventListener('scroll', scrollListener) }, [show]) - return (
scrollToBottom()}> -
- -
- {showPercent && (
{percent}
)} -
) + return (
+
+ +
+ {showPercent && (
{percent}%
)} +
) } export default JumpToBottomButton diff --git a/components/JumpToTopButton.js b/components/JumpToTopButton.js index c95c3111..f72ee0fa 100644 --- a/components/JumpToTopButton.js +++ b/components/JumpToTopButton.js @@ -17,7 +17,7 @@ const JumpToTopButton = ({ showPercent = true, percent }) => { return <> } const { locale } = useGlobal() - return (
window.scrollTo({ top: 0, behavior: 'smooth' })} > + return (
window.scrollTo({ top: 0, behavior: 'smooth' })} >
diff --git a/components/TocDrawerButton.js b/components/TocDrawerButton.js index 5f2db1f1..e828290e 100644 --- a/components/TocDrawerButton.js +++ b/components/TocDrawerButton.js @@ -16,10 +16,8 @@ const TocDrawerButton = (props) => { return <> } const { locale } = useGlobal() - return (
-
- -
+ return (
+
) } diff --git a/layouts/BaseLayout.js b/layouts/BaseLayout.js index d4b5b572..7418b0c4 100644 --- a/layouts/BaseLayout.js +++ b/layouts/BaseLayout.js @@ -97,7 +97,7 @@ const BaseLayout = ({
-
+