fix: make the post, comment, response content images responsive (#147)

This commit is contained in:
Awais Ansari
2022-04-25 15:12:51 +05:00
committed by GitHub
parent 847a3b25ec
commit 3be40852eb
4 changed files with 11 additions and 3 deletions

View File

@@ -74,7 +74,7 @@ function Comment({
<CommentEditor comment={comment} onCloseEditor={() => setEditing(false)} />
)
// eslint-disable-next-line react/no-danger
: <div className="comment-body px-2" dangerouslySetInnerHTML={{ __html: comment.renderedBody }} />}
: <div className="comment-body px-2" id="comment" dangerouslySetInnerHTML={{ __html: comment.renderedBody }} />}
<CommentIcons
comment={comment}
following={comment.following}

View File

@@ -78,7 +78,7 @@ function Reply({
{isEditing
? <CommentEditor comment={reply} onCloseEditor={() => setEditing(false)} />
// eslint-disable-next-line react/no-danger
: <div dangerouslySetInnerHTML={{ __html: reply.renderedBody }} />}
: <div id="reply" dangerouslySetInnerHTML={{ __html: reply.renderedBody }} />}
</div>
</div>
<div className="text-gray-500 align-self-end mt-2" title={reply.createdAt}>

View File

@@ -75,7 +75,7 @@ function Post({
<PostHeader post={post} actionHandlers={actionHandlers} />
<div className="d-flex my-2 text-break">
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: post.renderedBody }} />
<div id="post" dangerouslySetInnerHTML={{ __html: post.renderedBody }} />
</div>
{topicContext && topic && (
<div className="border p-3 rounded mb-3 mt-2 align-self-start">

View File

@@ -5,3 +5,11 @@
$fa-font-path: "~font-awesome/fonts";
@import "~font-awesome/scss/font-awesome";
#post, #comment, #reply {
img {
height: auto;
max-width: 100%;
}
}