fix-gitbook

This commit is contained in:
tangly1024
2023-07-08 12:03:12 +08:00
parent b581110d19
commit 10199ed983
4 changed files with 28 additions and 25 deletions

View File

@@ -1,6 +1,7 @@
import NavPostListEmpty from './NavPostListEmpty'
import { useRouter } from 'next/router'
import NavPostItem from './NavPostItem'
import { useGitBookGlobal } from '..'
/**
* 博客列表滚动分页
@@ -10,8 +11,8 @@ import NavPostItem from './NavPostItem'
* @constructor
*/
const NavPostList = (props) => {
const { posts = [], currentSearch } = props
const filteredPosts = Object.assign(posts)
const { filteredPosts } = useGitBookGlobal()
const router = useRouter()
let selectedSth = false
@@ -34,7 +35,7 @@ const NavPostList = (props) => {
}
if (!filteredPosts || filteredPosts.length === 0) {
return <NavPostListEmpty currentSearch={currentSearch} />
return <NavPostListEmpty />
} else {
return <div id='posts-wrapper' className='w-full flex-grow'>
{/* 文章列表 */}

View File

@@ -8,8 +8,8 @@ import NavPostList from './NavPostList'
* @returns {JSX.Element}
* @constructor
*/
const PageNavDrawer = ({ post, cRef }) => {
const { pageNavVisible, changePageNavVisible, filterPosts } = useGitBookGlobal()
const PageNavDrawer = (props) => {
const { pageNavVisible, changePageNavVisible } = useGitBookGlobal()
const switchVisible = () => {
changePageNavVisible(!pageNavVisible)
}
@@ -22,7 +22,7 @@ const PageNavDrawer = ({ post, cRef }) => {
' overflow-y-hidden shadow-card w-72 duration-200 fixed left-1 top-16 rounded py-2 bg-white dark:bg-gray-600'}>
<div className='dark:text-gray-400 text-gray-600 h-96 overflow-y-scroll p-3'>
{/* 所有文章列表 */}
<NavPostList posts={filterPosts} />
<NavPostList />
</div>
</div>
</div>