diff --git a/src/app/(landing)/_components/feature-icons.tsx b/src/app/(landing)/_components/feature-icons.tsx index 71f930e..85202ad 100644 --- a/src/app/(landing)/_components/feature-icons.tsx +++ b/src/app/(landing)/_components/feature-icons.tsx @@ -309,7 +309,7 @@ const ReactEmail = forwardRef>( xmlns="http://www.w3.org/2000/svg" className={cn(className)} > - + { if (!post) return null; const formRef = useRef(null); const updatePost = api.post.update.useMutation(); - const form = useForm({ defaultValues: { title: post.title, @@ -51,7 +51,21 @@ export const PostEditor = ({ post }: Props) => { }); return ( -
+ <> +
+ +

{post.title}

+ + formRef.current?.requestSubmit()} + className="ml-auto" + > + Save + +
+
{ -
+

@@ -119,23 +133,6 @@ export const PostEditor = ({ post }: Props) => { />

- {/*
-

Post Preview

-
-

- by {post.user.email} at{" "} - {post.createdAt.toLocaleString(undefined, { - dateStyle: "medium", - timeStyle: "short", - })} -

-

{post.title}

-

{post.excerpt}

-
- -
-
-
*/} -
+ ); }; diff --git a/src/app/(main)/editor/[postId]/page.tsx b/src/app/(main)/editor/[postId]/page.tsx index 97b055a..ba44c14 100644 --- a/src/app/(main)/editor/[postId]/page.tsx +++ b/src/app/(main)/editor/[postId]/page.tsx @@ -2,9 +2,7 @@ import React from "react"; import { api } from "@/trpc/server"; import { notFound } from "next/navigation"; import { PostEditor } from "./_components/post-editor"; -import { Button } from "@/components/ui/button"; -import { Pencil2Icon } from "@/components/icons"; -import { ArrowLeftIcon, ChevronLeftIcon } from "@radix-ui/react-icons"; +import { ArrowLeftIcon } from "@/components/icons"; import Link from "next/link"; interface Props { @@ -26,13 +24,7 @@ export default async function EditPostPage({ params }: Props) { > back to dashboard -
- -

{post.title}

- -
-
); diff --git a/src/components/icons.tsx b/src/components/icons.tsx index fe314ad..1fb48eb 100644 --- a/src/components/icons.tsx +++ b/src/components/icons.tsx @@ -111,4 +111,5 @@ export { ChevronLeftIcon, ChevronRightIcon, DotsHorizontalIcon, + ArrowLeftIcon, } from "@radix-ui/react-icons";