mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-31 07:26:43 +00:00
Drawer的文章分类
This commit is contained in:
@@ -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 }) => {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 分类 */}
|
||||
{categories && (
|
||||
<div className='mt-2'>
|
||||
<PostsCategories currentCategory={currentCategory} categories={categories}/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 标签云 */}
|
||||
{tags && (
|
||||
<div className='mt-2'>
|
||||
|
||||
Reference in New Issue
Block a user