From bca62365d3fcccd123491cf378dcee72a1ef6096 Mon Sep 17 00:00:00 2001 From: tangly Date: Sat, 4 Dec 2021 16:39:45 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E7=AE=80=E5=8C=96=E5=B1=82=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/DarkModeButton.js | 2 +- components/JumpToTopButton.js | 2 +- components/SideBar.js | 14 ++++---------- components/SideBarDrawer.js | 6 +++--- components/TopNav.js | 10 +++++----- layouts/BaseLayout.js | 20 +++++++++----------- pages/article/[slug].js | 22 +++++++++++----------- 7 files changed, 34 insertions(+), 42 deletions(-) diff --git a/components/DarkModeButton.js b/components/DarkModeButton.js index a5031881..c5297176 100644 --- a/components/DarkModeButton.js +++ b/components/DarkModeButton.js @@ -12,7 +12,7 @@ const DarkModeButton = () => { changeTheme(newTheme) } return
-
} diff --git a/components/JumpToTopButton.js b/components/JumpToTopButton.js index 30855701..96f6c548 100644 --- a/components/JumpToTopButton.js +++ b/components/JumpToTopButton.js @@ -41,7 +41,7 @@ const JumpToTopButton = ({ targetRef, showPercent = true }) => {
- {showPercent && (
{percent}
)} + {showPercent && (
{percent}
)} ) diff --git a/components/SideBar.js b/components/SideBar.js index c8201b00..f2ca7eae 100644 --- a/components/SideBar.js +++ b/components/SideBar.js @@ -26,20 +26,16 @@ import { faAngleDoubleRight, faArchive, faTags, faThList } from '@fortawesome/fr const SideBar = ({ tags, currentTag, post, posts, categories, currentCategory, currentSearch }) => { const { locale } = useGlobal() return } diff --git a/components/SideBarDrawer.js b/components/SideBarDrawer.js index f8eff130..5b593bc5 100644 --- a/components/SideBarDrawer.js +++ b/components/SideBarDrawer.js @@ -18,14 +18,14 @@ const SideBarDrawer = ({ post, currentTag, cRef, tags, posts, categories, curren const switchSideDrawerVisible = () => { changeHiddenStatus(!isHidden) } - return
+ return <>
{/* 背景蒙版 */} -
-
+ } export default SideBarDrawer diff --git a/components/TopNav.js b/components/TopNav.js index 1917c5af..db4ceee6 100644 --- a/components/TopNav.js +++ b/components/TopNav.js @@ -1,14 +1,14 @@ import { useRef } from 'react' import DarkModeButton from '@/components/DarkModeButton' -import SearchInput from '@/components/SearchInput' import SideBarDrawer from '@/components/SideBarDrawer' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faBars } from '@fortawesome/free-solid-svg-icons' +import BLOG from '@/blog.config' const TopNav = ({ tags, currentTag, post, posts, currentSearch, categories, currentCategory }) => { const drawer = useRef() - return (<> + return (
{/* 侧面抽屉 */} @@ -18,7 +18,7 @@ const TopNav = ({ tags, currentTag, post, posts, currentSearch, categories, curr {/* 左侧LOGO */}
{ drawer.current.handleSwitchSideDrawerVisible() }} - className='fixed top-3 left-0 z-30 py-1 px-5 text-gray-600 text-2xl cursor-pointer dark:text-gray-300'> + className='fixed top-3 left-0 z-30 ml-5 text-gray-600 text-2xl cursor-pointer dark:text-gray-300'>
@@ -26,7 +26,7 @@ const TopNav = ({ tags, currentTag, post, posts, currentSearch, categories, curr {/* 中间搜索框 */}
- + {BLOG.title} | {BLOG.description}
{/* 右侧功能 */} @@ -36,7 +36,7 @@ const TopNav = ({ tags, currentTag, post, posts, currentSearch, categories, curr
- ) +
) } export default TopNav diff --git a/layouts/BaseLayout.js b/layouts/BaseLayout.js index 066f934d..5e276104 100644 --- a/layouts/BaseLayout.js +++ b/layouts/BaseLayout.js @@ -69,27 +69,25 @@ const BaseLayout = ({ {/* 顶部导航栏 */} -
- -
+ {/* Middle Wrapper */} -
+
{children}
- -
- -
-
+