fix: redundant markdown module execution
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { useDebounceEffect } from "ahooks"
|
||||
import type { Root } from "mdast"
|
||||
import { nanoid } from "nanoid"
|
||||
import dynamic from "next/dynamic"
|
||||
import { useParams, useRouter, useSearchParams } from "next/navigation"
|
||||
import {
|
||||
ChangeEvent,
|
||||
@@ -20,7 +21,6 @@ import type { EditorView } from "@codemirror/view"
|
||||
import { DateInput } from "@mantine/dates"
|
||||
import { useQueryClient } from "@tanstack/react-query"
|
||||
|
||||
import { PageContent } from "~/components/common/PageContent"
|
||||
import { DashboardMain } from "~/components/dashboard/DashboardMain"
|
||||
import { OptionsButton } from "~/components/dashboard/OptionsButton"
|
||||
import { PublishButton } from "~/components/dashboard/PublishButton"
|
||||
@@ -65,6 +65,13 @@ import {
|
||||
} from "~/queries/page"
|
||||
import { useGetSite } from "~/queries/site"
|
||||
|
||||
const DynamicPageContent = dynamic(
|
||||
() => import("~/components/common/PageContent"),
|
||||
{
|
||||
ssr: false,
|
||||
},
|
||||
)
|
||||
|
||||
export default function SubdomainEditor() {
|
||||
const router = useRouter()
|
||||
const queryClient = useQueryClient()
|
||||
@@ -655,7 +662,7 @@ export default function SubdomainEditor() {
|
||||
</div>
|
||||
)}
|
||||
{isRendering && (
|
||||
<PageContent
|
||||
<DynamicPageContent
|
||||
className="bg-white px-5 overflow-scroll pb-[200px] h-full flex-1"
|
||||
parsedContent={parsedContent}
|
||||
inputRef={previewRef}
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
"use client"
|
||||
|
||||
import { PageContent } from "~/components/common/PageContent"
|
||||
import dynamic from "next/dynamic"
|
||||
|
||||
import { useTranslation } from "~/lib/i18n/client"
|
||||
import { useGetPage } from "~/queries/page"
|
||||
import { useGetSite } from "~/queries/site"
|
||||
|
||||
const DynamicPageContent = dynamic(
|
||||
() => import("~/components/common/PageContent"),
|
||||
{
|
||||
ssr: false,
|
||||
},
|
||||
)
|
||||
|
||||
export default function SitePreviewPage({
|
||||
params,
|
||||
}: {
|
||||
@@ -46,11 +54,11 @@ export default function SitePreviewPage({
|
||||
</h2>
|
||||
)}
|
||||
</div>
|
||||
<PageContent
|
||||
<DynamicPageContent
|
||||
className="mt-10"
|
||||
content={page.data?.metadata?.content?.content}
|
||||
toc={true}
|
||||
></PageContent>
|
||||
></DynamicPageContent>
|
||||
</article>
|
||||
</>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user