updates and fixes

* seo friendly urls
* custom client serve-static module
* database fixes
* fix recent pages
* other fixes
This commit is contained in:
Philipinho
2024-05-18 03:19:42 +01:00
parent eefe63d1cd
commit 9c7c2f1163
102 changed files with 921 additions and 536 deletions

View File

@ -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>
)
);
}