diff --git a/src/components/Post.tsx b/src/components/Post.tsx index 01ff3805cb8a2f2d1198496531d00d08bdda7ba4..03a16365243c8f90d20e366071495107e293d480 100644 --- a/src/components/Post.tsx +++ b/src/components/Post.tsx @@ -33,12 +33,12 @@ type PostProps = { comments: number; comment_post: Instalike.Comment[]; inFeed: boolean; - canCommment: boolean; + comment_able: boolean; }; -const Post = ({ post, postid, username, location, time_post, img, caption, isLiked, likes, comments, comment_post, inFeed, canCommment }: PostProps) => { +const Post = ({ post, postid, username, location, time_post, img, caption, isLiked, likes, comments, comment_post, inFeed, comment_able }: PostProps) => { const dispatch = useAppDispatch(); const [dropdownOpen, setDropdownOpen] = useState(false); const [navigateToPost, setnavigateToPost] = useState(false); @@ -180,9 +180,11 @@ const Post = ({ post, postid, username, location, time_post, img, caption, isLik </div> </div> {/* ADD COMMENT */} + {comment_able === false && <div> <AddComment idPost={post.id} key={post.id}></AddComment> </div> + } {/* COMMENTS POST */} <div className={`border-t-${comments > 0 ? '[0.8px] p-4' : '0' } flex flex-col gap-4`}> <Comment tab_comments={comment_post}></Comment> diff --git a/src/views/PostView.tsx b/src/views/PostView.tsx index 836eafc44a67782a08af9b85c3a7d64abe27df13..059797311d809cdec7754fd0d6dddd1880f0e9ff 100644 --- a/src/views/PostView.tsx +++ b/src/views/PostView.tsx @@ -47,6 +47,7 @@ const PostView = () => { comments={post.commentsCount} comment_post={post.previewComments} inFeed={false} + comment_able={post.hasCommentsDisabled} ></Post> )} </div>