diff --git a/components/Drawer.js b/components/Drawer.js index fa809a99..7d0964f2 100644 --- a/components/Drawer.js +++ b/components/Drawer.js @@ -1,5 +1,3 @@ -import Link from 'next/link' -import BLOG from '@/blog.config' import SearchInput from '@/components/SearchInput' import MenuButtonGroup from '@/components/MenuButtonGroup' import React, { useImperativeHandle, useState } from 'react' @@ -7,13 +5,14 @@ import InfoCard from '@/components/InfoCard' import TagList from '@/components/TagList' import Logo from '@/components/Logo' import LatestPosts from '@/components/LatestPosts' +import PostsCategories from '@/components/PostsCategories' /** * 抽屉面板,可以从侧面拉出 * @returns {JSX.Element} * @constructor */ -const Drawer = ({ post, currentTag, cRef, tags, posts }) => { +const Drawer = ({ post, currentTag, cRef, tags, posts, categories, currentCategory }) => { // 暴露给父组件 通过cRef.current.handleMenuClick 调用 useImperativeHandle(cRef, () => { return { @@ -62,6 +61,13 @@ const Drawer = ({ post, currentTag, cRef, tags, posts }) => { )} + {/* 分类 */} + {categories && ( +
+ +
+ )} + {/* 标签云 */} {tags && (
diff --git a/components/TopNav.js b/components/TopNav.js index ccf036fa..a1673e5a 100644 --- a/components/TopNav.js +++ b/components/TopNav.js @@ -5,13 +5,13 @@ import Drawer from '@/components/Drawer' import DrawerRight from '@/components/DrawerRight' import Logo from '@/components/Logo' -const TopNav = ({ tags, currentTag, post, posts, currentSearch }) => { +const TopNav = ({ tags, currentTag, post, posts, currentSearch, categories, currentCategory }) => { const drawer = useRef() const drawerRight = useRef() return (<> {/* 侧面抽屉 */} - + {/* 导航栏 */} diff --git a/layouts/BaseLayout.js b/layouts/BaseLayout.js index 522abf6a..64ae8f6d 100644 --- a/layouts/BaseLayout.js +++ b/layouts/BaseLayout.js @@ -37,7 +37,7 @@ const BaseLayout = ({ children, layout, fullWidth, tags, meta, post, totalPosts,
- + {/* Middle Wrapper */}