diff --git a/client/src/components/Comments/Comments.js b/client/src/components/Comments/Comments.js index 755a702..90c14db 100644 --- a/client/src/components/Comments/Comments.js +++ b/client/src/components/Comments/Comments.js @@ -5,12 +5,17 @@ import Head from "./Head"; import Form from "./Form"; import Content from "./Content"; import { CommentContext } from "../../contexts/CommentContext"; +import { UserContext } from "../../contexts/UserContext"; const Comments = ({ show, handleShowComments, articleId }) => { const [display, setDisplay] = useState(false); const [loading, setLoading] = useState(true); // const [comments, setComments] = useState([]); + const { + state: { user }, + } = useContext(UserContext); + const { state: { comments @@ -60,7 +65,9 @@ const Comments = ({ show, handleShowComments, articleId }) => { handleShowComments={handleShowComments} count={comments.length} /> -
+ { + user._id && + }