feat(beta): public spaces (#2473)

This commit is contained in:
Philip Okugbe
2026-09-05 11:52:10 +01:00
committed by GitHub
parent f4796c982e
commit 876f3da1b2
117 changed files with 7592 additions and 715 deletions
+29 -18
View File
@@ -1,19 +1,18 @@
import { useNavigate, useParams } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { useSharePageQuery } from "@/features/share/queries/share-query.ts";
import { Container } from "@mantine/core";
import { Skeleton, Stack } from "@mantine/core";
import React, { useEffect } from "react";
import ReadonlyPageEditor from "@/features/editor/readonly-page-editor.tsx";
import { extractPageSlugId } from "@/lib";
import { Error404 } from "@/components/ui/error-404.tsx";
import ShareBranding from "@/features/share/components/share-branding.tsx";
import { useAtomValue } from "jotai";
import {
sharedPageFullWidthAtom,
sharedTreeDataAtom,
} from "@/features/share/atoms/shared-page-atom.ts";
import { sharedTreeDataAtom } from "@/features/share/atoms/shared-page-atom.ts";
import { isPageInTree } from "@/features/share/utils.ts";
import { DocumentTitle } from "@/components/ui/document-title.tsx";
import DocsBreadcrumbs from "@/features/public-space/components/docs/docs-breadcrumbs.tsx";
import DocsPageNav from "@/features/public-space/components/docs/docs-page-nav.tsx";
import DocsFooterBranding from "@/features/public-space/components/docs/docs-footer-branding.tsx";
export default function SharedPage() {
const { t } = useTranslation();
@@ -26,7 +25,6 @@ export default function SharedPage() {
});
const sharedTreeData = useAtomValue(sharedTreeDataAtom);
const fullWidth = useAtomValue(sharedPageFullWidthAtom);
useEffect(() => {
if (shareId && data) {
@@ -44,7 +42,16 @@ export default function SharedPage() {
}, [shareId, data, sharedTreeData]);
if (isLoading) {
return <></>;
return (
<Stack gap="md" pt={4} aria-hidden>
<Skeleton height={13} width={180} radius="sm" />
<Skeleton height={34} width="55%" radius="sm" mt={10} />
<Skeleton height={12} width="90%" radius="sm" mt={18} />
<Skeleton height={12} width="97%" radius="sm" />
<Skeleton height={12} width="85%" radius="sm" />
<Skeleton height={12} width="60%" radius="sm" />
</Stack>
);
}
if (isError || !data) {
@@ -65,17 +72,21 @@ export default function SharedPage() {
)}
</DocumentTitle>
<Container fluid={fullWidth} size={fullWidth ? undefined : 900} p={0}>
<ReadonlyPageEditor
key={data.page.id}
title={data.page.title}
content={data.page.content}
pageId={data.page.id}
shareId={data.share.id}
/>
</Container>
<DocsBreadcrumbs />
{data && !shareId && !(data.features?.length > 0) && <ShareBranding />}
<ReadonlyPageEditor
key={data.page.id}
title={data.page.title}
content={data.page.content}
pageId={data.page.id}
shareId={data.share.id}
trailingSpace={false}
/>
<DocsPageNav />
{/* No tree query without a shareId, so the shell can't own branding here. */}
{!shareId && <DocsFooterBranding refSource="public-share" />}
</div>
);
}