import React from 'react' import { ArticleLock } from './components/ArticleLock' import HeaderArticle from './components/HeaderArticle' import LayoutBase from './LayoutBase' import Comment from '@/components/Comment' import NotionPage from '@/components/NotionPage' import ArticleAdjacent from './components/ArticleAdjacent' import ArticleCopyright from './components/ArticleCopyright' import { ArticleInfo } from './components/ArticleInfo' import Catalog from './components/Catalog' import JumpToCommentButton from './components/JumpToCommentButton' export const LayoutSlug = props => { const { post, lock, validPassword } = props const [show, switchShow] = React.useState(false) const scrollListener = () => { const scrollY = window.pageYOffset const shouldShow = scrollY > 220 && post?.toc?.length > 0 if (shouldShow !== show) { switchShow(shouldShow) } } React.useEffect(() => { document.addEventListener('scroll', scrollListener) return () => document.removeEventListener('scroll', scrollListener) }, [show]) if (!post) { return } {...props} showCategory={false} showTag={false} > } return ( } {...props} showCategory={false} showTag={false} >
{lock && } {!lock &&
{post?.type === 'Post' && <>

}
{/* Notion文章主体 */}
{post && }
{/* 文章内嵌广告 */}
{post.type === 'Post' && }

{/* 评论互动 */}
}
{post.type === 'Post' && } {post?.toc?.length > 0 &&
}
) }