Commit ab2a4fbe authored by Xavier Watkins's avatar Xavier Watkins
Browse files

Update hooks for text area

parent d57c5e3a
import React from 'react';
import PropTypes from 'prop-types';
import ReactMarkdown from 'react-markdown';
import React from "react";
import PropTypes from "prop-types";
import ReactMarkdown from "react-markdown";
import '../../../styles/Comment.scss';
import "../../../styles/Comment.scss";
const Comment = (props) => {
const { details } = props;
......@@ -14,7 +14,7 @@ const Comment = (props) => {
<div className="comment__details">
<span className="comment__username">{details.user}</span>
<span className="comment__date">{details.timeAdded}</span>
<ReactMarkdown source={details.text} />
<ReactMarkdown>{details.text}</ReactMarkdown>
</div>
</div>
</div>
......
......@@ -95,6 +95,7 @@ const CommentsAndStatusModal = ({
[]
);
const [displayModal, setDisplayModal] = useState(false);
const [textEditor, setTextEditor] = useState();
const textEditorRef = useCallback(() => {
if (textEditorRef.current !== null) {
......@@ -109,6 +110,7 @@ const CommentsAndStatusModal = ({
);
textEditor.render(document.getElementById("text-editor"));
textEditor.value(localStorage.getItem(createId(id)) || "");
setTextEditor(textEditor);
}
}, [id]);
......@@ -164,8 +166,6 @@ const CommentsAndStatusModal = ({
const userToken = cookies.get("userToken");
let textEditor = null;
return (
<div className="comments-section">
<div className="row">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment