mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-06 15:10:29 +00:00
gitbook 亿点细节
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import { useGlobal } from '@/lib/global'
|
import { useGlobal } from '@/lib/global'
|
||||||
import { useGitBookGlobal } from '@/themes/gitbook'
|
import { useGitBookGlobal } from '@/themes/gitbook'
|
||||||
|
import { useRouter } from 'next/router'
|
||||||
|
import { useEffect } from 'react'
|
||||||
import Catalog from './Catalog'
|
import Catalog from './Catalog'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12,9 +14,13 @@ import Catalog from './Catalog'
|
|||||||
const CatalogDrawerWrapper = ({ post, cRef }) => {
|
const CatalogDrawerWrapper = ({ post, cRef }) => {
|
||||||
const { tocVisible, changeTocVisible } = useGitBookGlobal()
|
const { tocVisible, changeTocVisible } = useGitBookGlobal()
|
||||||
const { locale } = useGlobal()
|
const { locale } = useGlobal()
|
||||||
|
const router = useRouter()
|
||||||
const switchVisible = () => {
|
const switchVisible = () => {
|
||||||
changeTocVisible(!tocVisible)
|
changeTocVisible(!tocVisible)
|
||||||
}
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
changeTocVisible(false)
|
||||||
|
}, [router])
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { useGlobal } from '@/lib/global'
|
import { useGlobal } from '@/lib/global'
|
||||||
import { useGitBookGlobal } from '@/themes/gitbook'
|
import { useGitBookGlobal } from '@/themes/gitbook'
|
||||||
|
import { useRouter } from 'next/router'
|
||||||
|
import { useEffect } from 'react'
|
||||||
import NavPostList from './NavPostList'
|
import NavPostList from './NavPostList'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,11 +15,15 @@ const PageNavDrawer = props => {
|
|||||||
const { pageNavVisible, changePageNavVisible } = useGitBookGlobal()
|
const { pageNavVisible, changePageNavVisible } = useGitBookGlobal()
|
||||||
const { filteredNavPages } = props
|
const { filteredNavPages } = props
|
||||||
const { locale } = useGlobal()
|
const { locale } = useGlobal()
|
||||||
|
const router = useRouter()
|
||||||
const switchVisible = () => {
|
const switchVisible = () => {
|
||||||
changePageNavVisible(!pageNavVisible)
|
changePageNavVisible(!pageNavVisible)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
changePageNavVisible(false)
|
||||||
|
}, [router])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ const LayoutBase = props => {
|
|||||||
)}
|
)}
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
{/* 移动端底部按钮 */}
|
{/* 移动端底部导航按钮 */}
|
||||||
<div className='bottom-button-group md:hidden w-screen h-12 px-4 fixed flex items-center justify-between right-0 bottom-0 z-30 bg-white border-l border-t dark:border-gray-800'>
|
<div className='bottom-button-group md:hidden w-screen h-12 px-4 fixed flex items-center justify-between right-0 bottom-0 z-30 bg-white border-l border-t dark:border-gray-800'>
|
||||||
<div className='w-full'>
|
<div className='w-full'>
|
||||||
<MobileButtonPageNav />
|
<MobileButtonPageNav />
|
||||||
|
|||||||
Reference in New Issue
Block a user