gitbook 亿点细节

This commit is contained in:
tangly1024.com
2024-06-04 09:45:30 +08:00
parent dc7e53343c
commit e499ccb3a6
3 changed files with 14 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
import { useGlobal } from '@/lib/global'
import { useGitBookGlobal } from '@/themes/gitbook'
import { useRouter } from 'next/router'
import { useEffect } from 'react'
import Catalog from './Catalog'
/**
@@ -12,9 +14,13 @@ import Catalog from './Catalog'
const CatalogDrawerWrapper = ({ post, cRef }) => {
const { tocVisible, changeTocVisible } = useGitBookGlobal()
const { locale } = useGlobal()
const router = useRouter()
const switchVisible = () => {
changeTocVisible(!tocVisible)
}
useEffect(() => {
changeTocVisible(false)
}, [router])
return (
<>
<div

View File

@@ -1,5 +1,7 @@
import { useGlobal } from '@/lib/global'
import { useGitBookGlobal } from '@/themes/gitbook'
import { useRouter } from 'next/router'
import { useEffect } from 'react'
import NavPostList from './NavPostList'
/**
@@ -13,11 +15,15 @@ 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 (
<>
<div