diff --git a/pkg/view/src/components/PostItem.tsx b/pkg/view/src/components/PostItem.tsx index 73f989d..ea6a7c3 100644 --- a/pkg/view/src/components/PostItem.tsx +++ b/pkg/view/src/components/PostItem.tsx @@ -10,6 +10,7 @@ export default function PostItem(props: { noAuthor?: boolean, noControl?: boolean, noRelated?: boolean, + noContent?: boolean, onRepost?: (post: any) => void, onReply?: (post: any) => void, onEdit?: (post: any) => void, @@ -63,69 +64,72 @@ export default function PostItem(props: { -
-

{props.post.title}

- - - {content} - - + +
+

{props.post.title}

+ + + {content} + + -
- - {item => - - - {item.name} - - } - - - {item => - - - {item.name} - - } - +
+ + {item => + + + {item.name} + + } + + + {item => + + + {item.name} + + } + +
+ + 0}> +
+ +
+
+ + +

+ + Reposted a post +

+
+ +
+
+ +

+ + Replied a post +

+
+ +
+
+ - 0}> -
- -
-
- - -

- - Reposted a post -

-
- -
-
- -

- - Replied a post -

-
- -
-
-
diff --git a/pkg/view/src/layouts/RootLayout.tsx b/pkg/view/src/layouts/RootLayout.tsx index 4a877ba..b3ff32d 100644 --- a/pkg/view/src/layouts/RootLayout.tsx +++ b/pkg/view/src/layouts/RootLayout.tsx @@ -35,7 +35,7 @@ export default function RootLayout(props: any) { } const mainContentStyles = createMemo(() => { - if (!searchParams["noTitle"]) { + if (!searchParams["embedded"]) { return "h-[calc(100vh-64px)] mt-[64px]"; } else { return "h-[100vh]"; @@ -50,7 +50,7 @@ export default function RootLayout(props: any) {
}> - + diff --git a/pkg/view/src/pages/post.tsx b/pkg/view/src/pages/post.tsx index 28d2a43..2ce2d68 100644 --- a/pkg/view/src/pages/post.tsx +++ b/pkg/view/src/pages/post.tsx @@ -1,5 +1,5 @@ import { createSignal, Show } from "solid-js"; -import { useNavigate, useParams } from "@solidjs/router"; +import { useNavigate, useParams, useSearchParams } from "@solidjs/router"; import { createStore } from "solid-js/store"; import { closeModel, openModel } from "../scripts/modals.ts"; import PostPublish from "../components/PostPublish.tsx"; @@ -17,6 +17,8 @@ export default function PostPage() { const params = useParams(); const navigate = useNavigate(); + const [searchParams] = useSearchParams(); + async function readPost(pn?: number) { if (pn) setPage(pn); const res = await fetch(`/api/posts/${params["postId"]}?` + new URLSearchParams({ @@ -96,11 +98,17 @@ export default function PostPage() {
- + back()}> + + + }> +
+ +
+
-

Post #{info()?.id}

+

{searchParams["title"] ?? "Post details"}

@@ -129,6 +137,9 @@ export default function PostPage() { onError={setError} onReact={readPost} onDelete={deletePost} + noAuthor={searchParams["noAuthor"] != null} + noContent={searchParams["noContent"] != null} + noControl={searchParams["noControl"] != null} onRepost={(item) => setMeta(item, "reposting")} onReply={(item) => setMeta(item, "replying")} onEdit={(item) => setMeta(item, "editing")}