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) // eslint-disable-next-line react-hooks/exhaustive-deps }, [router]) return ( <>
{/* 側邊選單 */}
{locale.COMMON.ARTICLE_LIST} { changePageNavVisible(false) }}>
{/* 所有文章列表 */}
{/* 背景遮罩 */}
) } export default PageNavDrawer