Skip to content

Commit

Permalink
removed preview button and it's associated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Prakhar29Sharma committed Sep 24, 2024
1 parent cb6732f commit 0dc54e6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
23 changes: 0 additions & 23 deletions app/(app)/alpha/new/[[...postIdArr]]/_client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const Create = () => {
const postId = params?.postIdArr?.[0] || "";

const {
viewPreview,
setViewPreview,
tags,
tagValue,
savedTime,
Expand Down Expand Up @@ -54,13 +52,6 @@ const Create = () => {

return (
<>
<button
type="button"
className="absolute right-10 top-10 mt-4 inline-flex justify-center border border-neutral-300 bg-white px-4 py-2 text-sm font-medium text-neutral-600 shadow-sm hover:bg-neutral-50 focus:outline-none focus:ring-2 focus:ring-pink-300 focus:ring-offset-2"
onClick={() => setViewPreview((current) => !current)}
>
Preview
</button>
<form onSubmit={handleSubmit(onSubmit)}>
<Transition show={open} as={Fragment}>
<div className="fixed bottom-0 left-0 top-0 z-50 h-screen w-full bg-black">
Expand Down Expand Up @@ -232,19 +223,6 @@ const Create = () => {
{/* Start main area*/}
<div className="relative h-full">
<div className="bg-neutral-900 text-white shadow-xl">
{viewPreview ? (
<section className="mx-auto max-w-xl px-4 py-6 pb-4 sm:p-6 lg:pb-8">
<article
className="prose prose-invert lg:prose-lg"
style={{
whiteSpace: "pre-wrap",
overflowWrap: "anywhere",
}}
>
<RenderPost json={body} />
</article>
</section>
) : (
<div className="bg-neutral-900 px-4 py-6 sm:p-6 lg:pb-8">
{!body && (
<Controller
Expand Down Expand Up @@ -296,7 +274,6 @@ const Create = () => {
</div>
</div>
</div>
)}
</div>
</div>
{/* End main area */}
Expand Down
4 changes: 0 additions & 4 deletions hooks/useCreatePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { redirect, useRouter } from "next/navigation";

export type useCreatePageReturnType = {
viewPreview: boolean;
setViewPreview: React.Dispatch<React.SetStateAction<boolean>>;
tags: string[];
setTags: React.Dispatch<React.SetStateAction<string[]>>;
tagValue: string;
Expand Down Expand Up @@ -60,7 +59,6 @@ type useCreatepagePropTypes = {
function useCreatePage({
postId,
}: useCreatepagePropTypes): useCreatePageReturnType {
const [viewPreview, setViewPreview] = useState<boolean>(false);
const [tags, setTags] = useState<string[]>([]);
const [tagValue, setTagValue] = useState<string>("");
const [savedTime, setSavedTime] = useState<string>("");
Expand Down Expand Up @@ -276,8 +274,6 @@ function useCreatePage({
};

return {
viewPreview,
setViewPreview,
tags,
setTags,
tagValue,
Expand Down

0 comments on commit 0dc54e6

Please sign in to comment.