diff --git a/front_end/src/components/comment_feed/comment.tsx b/front_end/src/components/comment_feed/comment.tsx index 3928aaa69a..6a5350a7dc 100644 --- a/front_end/src/components/comment_feed/comment.tsx +++ b/front_end/src/components/comment_feed/comment.tsx @@ -144,6 +144,7 @@ const Comment: FC = ({ const [isDeleted, setIsDeleted] = useState(comment.is_soft_deleted); const [isReplying, setIsReplying] = useState(false); const [commentMarkdown, setCommentMarkdown] = useState(comment.text); + const [tempCommentMarkdown, setTempCommentMarkdown] = useState(""); const [isReportModalOpen, setIsReportModalOpen] = useState(false); const { user } = useAuth(); @@ -218,6 +219,7 @@ const Comment: FC = ({ id: "edit", name: t("edit"), onClick: () => { + setTempCommentMarkdown(commentMarkdown); setIsEditing(true); }, }, @@ -346,15 +348,19 @@ const Comment: FC = ({ )} */}
- { - setCommentMarkdown(text); - }} - /> + {isEditing && ( + + )}{" "} + {!isEditing && ( + + )}
{isEditing && ( + <> + + }} + > + {t("cancel")} + + )}