diff --git a/web/src/components/MemoContent/index.tsx b/web/src/components/MemoContent/index.tsx index 735b73fd..a3f11487 100644 --- a/web/src/components/MemoContent/index.tsx +++ b/web/src/components/MemoContent/index.tsx @@ -1,35 +1,17 @@ -import { isUndefined } from "lodash-es"; -import { useEffect, useRef, useState } from "react"; -import { markdownServiceClient } from "@/grpcweb"; +import { useRef } from "react"; import { Node } from "@/types/proto/api/v2/markdown_service"; import Renderer from "./Renderer"; interface Props { - content: string; - nodes?: Node[]; + nodes: Node[]; className?: string; onMemoContentClick?: (e: React.MouseEvent) => void; } const MemoContent: React.FC = (props: Props) => { - const { className, content, onMemoContentClick } = props; - const [nodes, setNodes] = useState(props.nodes ?? []); + const { className, onMemoContentClick } = props; const memoContentContainerRef = useRef(null); - useEffect(() => { - if (!isUndefined(props.nodes)) { - return; - } - - markdownServiceClient - .parseMarkdown({ - markdown: content, - }) - .then(({ nodes }) => { - setNodes(nodes); - }); - }, [content, props.nodes]); - const handleMemoContentClick = async (e: React.MouseEvent) => { if (onMemoContentClick) { onMemoContentClick(e); @@ -43,7 +25,7 @@ const MemoContent: React.FC = (props: Props) => { className="w-full max-w-full word-break text-base leading-6 space-y-1" onClick={handleMemoContentClick} > - {nodes.map((node, index) => ( + {props.nodes.map((node, index) => ( ))} diff --git a/web/src/components/MemoView.tsx b/web/src/components/MemoView.tsx index 7ee3f206..29f51467 100644 --- a/web/src/components/MemoView.tsx +++ b/web/src/components/MemoView.tsx @@ -205,7 +205,7 @@ const MemoView: React.FC = (props: Props) => {
{props.showVisibility && memo.visibility !== Visibility.PRIVATE && ( <> - + @@ -251,7 +251,7 @@ const MemoView: React.FC = (props: Props) => { )}
- + diff --git a/web/src/components/ShareMemoDialog.tsx b/web/src/components/ShareMemoDialog.tsx index c5c73269..7ac4eb00 100644 --- a/web/src/components/ShareMemoDialog.tsx +++ b/web/src/components/ShareMemoDialog.tsx @@ -100,7 +100,7 @@ const ShareMemoDialog: React.FC = (props: Props) => { > {getDateTimeString(memo.displayTime)}
- +
diff --git a/web/src/components/TimelineMemo.tsx b/web/src/components/TimelineMemo.tsx index d637e08e..e3558564 100644 --- a/web/src/components/TimelineMemo.tsx +++ b/web/src/components/TimelineMemo.tsx @@ -21,7 +21,7 @@ const TimelineMemo = (props: Props) => { #{memo.id}
- + diff --git a/web/src/pages/Archived.tsx b/web/src/pages/Archived.tsx index e795aedc..6126b7df 100644 --- a/web/src/pages/Archived.tsx +++ b/web/src/pages/Archived.tsx @@ -105,7 +105,7 @@ const Archived = () => { - + ))} diff --git a/web/src/pages/MemoDetail.tsx b/web/src/pages/MemoDetail.tsx index 15cae66f..5dbfbbbc 100644 --- a/web/src/pages/MemoDetail.tsx +++ b/web/src/pages/MemoDetail.tsx @@ -139,7 +139,7 @@ const MemoDetail = () => { )} - +