import { useGlobal } from '@/lib/global' import { useGitBookGlobal } from '@/themes/gitbook' import Catalog from './Catalog' /** * 悬浮抽屉目录 * @param toc * @param post * @returns {JSX.Element} * @constructor */ const CatalogDrawerWrapper = ({ post, cRef }) => { const { tocVisible, changeTocVisible } = useGitBookGlobal() const { locale } = useGlobal() const switchVisible = () => { changeTocVisible(!tocVisible) } return ( <>
{/* 侧边菜单 */}
{post && ( <>
{locale.COMMON.TABLE_OF_CONTENTS} { changeTocVisible(false) }}>
)}
{/* 背景蒙版 */}
) } export default CatalogDrawerWrapper