CSR
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
"use client";
|
||||
import { Editor } from "@/components/editor";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import useApiMutation from "@/hooks/use-api";
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
const Editor = dynamic(
|
||||
() => import("@/components/editor").then((mod) => mod.Editor),
|
||||
{ ssr: false },
|
||||
);
|
||||
import { useState } from "react";
|
||||
|
||||
export default function BlogEditor() {
|
||||
const {
|
||||
@@ -29,7 +25,7 @@ export default function BlogEditor() {
|
||||
className="text-black bg-white"
|
||||
onClick={async () => {
|
||||
try {
|
||||
const blogContent = localStorage.getItem("blog_draft");
|
||||
// const blogContent = localStorage.getItem("blog_draft");
|
||||
const res = await trigger({
|
||||
label: "This is my label",
|
||||
summary: "A summary",
|
||||
@@ -37,7 +33,7 @@ export default function BlogEditor() {
|
||||
href: "none",
|
||||
blogID: "id",
|
||||
slug: "myslug",
|
||||
content: blogContent,
|
||||
// content: blogContent,
|
||||
published: "",
|
||||
});
|
||||
if (!res)
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
import Editor from "./editor"
|
||||
"use client";
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
export default function NewBlog() {
|
||||
const Editor = dynamic(() => import("./editor").then((mod) => mod.default), {
|
||||
ssr: false,
|
||||
});
|
||||
|
||||
export default async function NewBlog() {
|
||||
return (
|
||||
<>
|
||||
<Editor />
|
||||
</>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -378,8 +378,8 @@ export function EditorMenu({ editor }: EditorMenuProps) {
|
||||
<ToggleGroupItem
|
||||
value="codeBlock"
|
||||
aria-label="Toggle code block"
|
||||
pressed={editor.isActive("codeBlock")}
|
||||
onPressedChanged={() =>
|
||||
aria-pressed={editor.isActive("codeBlock")}
|
||||
onClick={() =>
|
||||
editor
|
||||
.chain()
|
||||
.focus()
|
||||
|
||||
Reference in New Issue
Block a user