mirror of
https://github.com/docmost/docmost.git
synced 2025-11-13 17:42:37 +10:00
updates and fixes
* seo friendly urls * custom client serve-static module * database fixes * fix recent pages * other fixes
This commit is contained in:
@ -1,27 +1,31 @@
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { usePageQuery } from '@/features/page/queries/page-query';
|
||||
import { FullEditor } from '@/features/editor/full-editor';
|
||||
import HistoryModal from '@/features/page-history/components/history-modal';
|
||||
import { useParams } from "react-router-dom";
|
||||
import { usePageQuery } from "@/features/page/queries/page-query";
|
||||
import { FullEditor } from "@/features/editor/full-editor";
|
||||
import HistoryModal from "@/features/page-history/components/history-modal";
|
||||
import { Helmet } from "react-helmet-async";
|
||||
|
||||
export default function Page() {
|
||||
const { pageId } = useParams();
|
||||
const { data, isLoading, isError } = usePageQuery(pageId);
|
||||
const { slugId } = useParams();
|
||||
const { data: page, isLoading, isError } = usePageQuery(slugId);
|
||||
|
||||
if (isLoading) {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
if (isError || !data) { // TODO: fix this
|
||||
if (isError || !page) {
|
||||
// TODO: fix this
|
||||
return <div>Error fetching page data.</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
data && (
|
||||
page && (
|
||||
<div>
|
||||
<FullEditor pageId={pageId} title={data.title} />
|
||||
<HistoryModal />
|
||||
<Helmet>
|
||||
<title>{page.title}</title>
|
||||
</Helmet>
|
||||
<FullEditor pageId={page.id} title={page.title} slugId={page.slugId} />
|
||||
<HistoryModal pageId={page.id} />
|
||||
</div>
|
||||
)
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user