diff --git a/app/articles/[slug]/page.tsx b/app/articles/[slug]/page.tsx
index 0e676f7b..9cbc66e5 100644
--- a/app/articles/[slug]/page.tsx
+++ b/app/articles/[slug]/page.tsx
@@ -71,75 +71,44 @@ const ArticlePage = async ({ params }: Props) => {
return (
<>
-
- {/* @TODO confirm metadata is correct and remove */}
- {post.title}
- {post.canonicalUrl && }
-
-
-
-
-
-
-
-
-
-
-
- <>
-
-
-
- {post.title}
- {Markdoc.renderers.react(content, React, {
- components: markdocComponents,
- })}
-
- {post.tags.length > 0 && (
-
- {post.tags.map(({ tag }) => (
-
- {tag.title}
-
- ))}
-
- )}
-
-
-
- {post.showComments ? (
-
- ) : (
-
- Comments are disabled for this post
-
- )}
-
- >
-
+
+
+
+ {post.title}
+ {Markdoc.renderers.react(content, React, {
+ components: markdocComponents,
+ })}
+
+ {post.tags.length > 0 && (
+
+ {post.tags.map(({ tag }) => (
+
+ {tag.title}
+
+ ))}
+
+ )}
+
+
+
+ {post.showComments ? (
+
+ ) : (
+
+ Comments are disabled for this post
+
+ )}
+
{session && session?.user?.role === "ADMIN" && (
)}
diff --git a/app/create/[[...paramsArr]]/_client.tsx b/app/create/[[...paramsArr]]/_client.tsx
index 7acef062..78cb445d 100644
--- a/app/create/[[...paramsArr]]/_client.tsx
+++ b/app/create/[[...paramsArr]]/_client.tsx
@@ -29,14 +29,13 @@ const Create = () => {
const [viewPreview, setViewPreview] = useState(false);
const [tags, setTags] = useState([]);
- const [showComments, setShowComments] = useState(true);
const [tagValue, setTagValue] = useState("");
const [savedTime, setSavedTime] = useState("");
const [open, setOpen] = useState(false);
const [shouldRefetch, setShouldRefetch] = useState(true);
const [unsavedChanges, setUnsavedChanges] = useState(false);
- const [delayDebounce, setDelayDebounce] = useState(false);
- const allowUpdate = unsavedChanges && !delayDebounce;
+
+ const allowUpdate = unsavedChanges;
const textareaRef = useRef(null);
useMarkdownHotkeys(textareaRef);
@@ -54,7 +53,6 @@ const Create = () => {
defaultValues: {
title: "",
body: "",
- showComments: true,
},
});
@@ -206,9 +204,8 @@ const Create = () => {
useEffect(() => {
if (!data) return;
- const { body, excerpt, title, id, tags, showComments } = data;
+ const { body, excerpt, title, id, tags } = data;
setTags(tags.map(({ tag }) => tag.title));
- setShowComments(showComments);
reset({ body, excerpt, title, id });
}, [data]);
@@ -339,21 +336,6 @@ const Create = () => {
original source.
-
-
-
- setShowComments(e.target.checked),
- value: showComments,
- })}
- />
-
>
)}
diff --git a/schema/post.ts b/schema/post.ts
index b20b4486..4ac6c78e 100644
--- a/schema/post.ts
+++ b/schema/post.ts
@@ -24,7 +24,6 @@ export const SavePostSchema = z.object({
),
canonicalUrl: z.optional(z.string().trim().url()),
tags: z.string().array().max(5).optional(),
- showComments: z.boolean().optional(),
});
export const PublishPostSchema = z.object({
diff --git a/server/api/router/post.ts b/server/api/router/post.ts
index e2f73d36..7cd3eb7f 100644
--- a/server/api/router/post.ts
+++ b/server/api/router/post.ts
@@ -36,15 +36,7 @@ export const postRouter = createTRPCRouter({
update: protectedProcedure
.input(SavePostSchema)
.mutation(async ({ input, ctx }) => {
- const {
- id,
- body,
- title,
- excerpt,
- canonicalUrl,
- tags = [],
- showComments,
- } = input;
+ const { id, body, title, excerpt, canonicalUrl, tags = [] } = input;
const currentPost = await ctx.db.post.findUnique({
where: { id },
@@ -105,7 +97,6 @@ export const postRouter = createTRPCRouter({
excerpt: getExcerptValue() || "",
readTimeMins: readingTime(body),
canonicalUrl,
- showComments,
},
});
return post;