mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 15:09:22 +00:00
刷新页面导致Code重复
This commit is contained in:
@@ -1,12 +1,3 @@
|
||||
|
||||
import 'prismjs'
|
||||
import 'prismjs/components/prism-bash'
|
||||
import 'prismjs/components/prism-javascript'
|
||||
import 'prismjs/components/prism-markup'
|
||||
import 'prismjs/components/prism-python'
|
||||
import 'prismjs/components/prism-typescript'
|
||||
import 'prismjs/components/prism-java'
|
||||
|
||||
import { NotionRenderer } from 'react-notion-x'
|
||||
import mediumZoom from 'medium-zoom'
|
||||
import { useEffect, useRef } from 'react'
|
||||
@@ -14,27 +5,22 @@ import dynamic from 'next/dynamic'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
const Code = dynamic(() =>
|
||||
import('react-notion-x/build/third-party/code').then((m) => m.Code)
|
||||
import('react-notion-x/build/third-party/code').then((m) => m.Code), { ssr: false }
|
||||
)
|
||||
const Collection = dynamic(() =>
|
||||
import('react-notion-x/build/third-party/collection').then(
|
||||
(m) => m.Collection
|
||||
)
|
||||
import('react-notion-x/build/third-party/collection').then((m) => m.Collection), { ssr: false }
|
||||
)
|
||||
|
||||
const Equation = dynamic(() =>
|
||||
import('react-notion-x/build/third-party/equation').then((m) => m.Equation)
|
||||
import('react-notion-x/build/third-party/equation').then((m) => m.Equation), { ssr: false }
|
||||
)
|
||||
|
||||
const Pdf = dynamic(
|
||||
() => import('react-notion-x/build/third-party/pdf').then((m) => m.Pdf),
|
||||
{
|
||||
ssr: false
|
||||
}
|
||||
() => import('react-notion-x/build/third-party/pdf').then((m) => m.Pdf), { ssr: false }
|
||||
)
|
||||
|
||||
const Modal = dynamic(
|
||||
() => import('react-notion-x/build/third-party/modal').then((m) => m.Modal),
|
||||
{
|
||||
ssr: false
|
||||
}
|
||||
() => import('react-notion-x/build/third-party/modal').then((m) => m.Modal), { ssr: false }
|
||||
)
|
||||
const NotionPage = ({ post }) => {
|
||||
if (!post || !post.blockMap) {
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
import { getPageTableOfContents } from 'notion-utils'
|
||||
import 'prismjs'
|
||||
import 'prismjs/components/prism-bash'
|
||||
import 'prismjs/components/prism-javascript'
|
||||
import 'prismjs/components/prism-markup'
|
||||
import 'prismjs/components/prism-python'
|
||||
import 'prismjs/components/prism-typescript'
|
||||
import ArticleDetail from './components/ArticleDetail'
|
||||
import LayoutBase from './LayoutBase'
|
||||
import { ArticleLock } from './components/ArticleLock'
|
||||
@@ -18,8 +12,8 @@ export const LayoutSlug = (props) => {
|
||||
|
||||
return (
|
||||
<LayoutBase {...props} >
|
||||
{!lock && <ArticleDetail {...props} />}
|
||||
{lock && <ArticleLock password={post.password} validPassword={validPassword} />}
|
||||
</LayoutBase>
|
||||
{!lock && <ArticleDetail {...props} />}
|
||||
{lock && <ArticleLock password={post.password} validPassword={validPassword} />}
|
||||
</LayoutBase>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user