mirror of
https://github.com/docmost/docmost.git
synced 2025-11-19 01:51:09 +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,5 +1,13 @@
|
||||
import { LoginForm } from '@/features/auth/components/login-form';
|
||||
import { LoginForm } from "@/features/auth/components/login-form";
|
||||
import { Helmet } from "react-helmet-async";
|
||||
|
||||
export default function LoginPage() {
|
||||
return <LoginForm />;
|
||||
return (
|
||||
<>
|
||||
<Helmet>
|
||||
<title>Login</title>
|
||||
</Helmet>
|
||||
<LoginForm />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,5 +1,42 @@
|
||||
import { SignUpForm } from '@/features/auth/components/sign-up-form';
|
||||
import { SignUpForm } from "@/features/auth/components/sign-up-form";
|
||||
import { useWorkspacePublicDataQuery } from "@/features/workspace/queries/workspace-query.ts";
|
||||
import { SetupWorkspaceForm } from "@/features/auth/components/setup-workspace-form.tsx";
|
||||
import { Helmet } from "react-helmet-async";
|
||||
import React from "react";
|
||||
|
||||
export default function SignUpPage() {
|
||||
return <SignUpForm />;
|
||||
const {
|
||||
data: workspace,
|
||||
isLoading,
|
||||
isError,
|
||||
error,
|
||||
} = useWorkspacePublicDataQuery();
|
||||
|
||||
if (isLoading) {
|
||||
return <div></div>;
|
||||
}
|
||||
|
||||
if (
|
||||
isError &&
|
||||
error?.["response"]?.status === 404 &&
|
||||
error?.["response"]?.data.message.includes("Workspace not found")
|
||||
) {
|
||||
return (
|
||||
<>
|
||||
<Helmet>
|
||||
<title>Setup workspace</title>
|
||||
</Helmet>
|
||||
<SetupWorkspaceForm />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return workspace ? (
|
||||
<>
|
||||
<Helmet>
|
||||
<title>Signup</title>
|
||||
</Helmet>
|
||||
<SignUpForm />
|
||||
</>
|
||||
) : null;
|
||||
}
|
||||
|
||||
@ -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