import { useGlobal } from '@/lib/global' import { useGitBookGlobal } from '@/themes/gitbook' import { useRouter } from 'next/router' import { useEffect } from 'react' import NavPostList from './NavPostList' /** * 悬浮抽屉 页面内导航 * @param toc * @param post * @returns {JSX.Element} * @constructor */ const PageNavDrawer = props => { const { pageNavVisible, changePageNavVisible } = useGitBookGlobal() const { filteredNavPages } = props const { locale } = useGlobal() const router = useRouter() const switchVisible = () => { changePageNavVisible(!pageNavVisible) } useEffect(() => { changePageNavVisible(false) }, [router]) return ( <>
{/* 侧边菜单 */}
{locale.COMMON.ARTICLE_LIST} { changePageNavVisible(false) }}>
{/* 所有文章列表 */}
{/* 背景蒙版 */}
) } export default PageNavDrawer