improve style

This commit is contained in:
SrGooglo 2023-03-15 19:22:48 +00:00
parent 47d0ec5b5f
commit 5d46387b7d
2 changed files with 37 additions and 40 deletions

View File

@ -150,7 +150,9 @@ export default (props) => {
return <antd.Empty /> return <antd.Empty />
} }
return comments.map((comment) => { return <>
{
comments.map((comment) => {
return <CommentCard return <CommentCard
data={comment} data={comment}
onClickDelete={handleCommentDelete} onClickDelete={handleCommentDelete}
@ -158,6 +160,13 @@ export default (props) => {
/> />
}) })
} }
<antd.Result
status="info"
title="This is the end"
subTitle="There are no more comments"
/>
</>
}
return <div return <div
id="comments" id="comments"
@ -168,19 +177,13 @@ export default (props) => {
} }
)} )}
> >
<div className="header">
<h3>
<Icons.MessageSquare /> Comments
</h3>
</div>
{renderComments()}
<div className="commentCreatorWrapper">
<CommentCreator <CommentCreator
onSubmit={handleCommentSubmit} onSubmit={handleCommentSubmit}
maxLength={PostModel.maxCommentLength} maxLength={PostModel.maxCommentLength}
/> />
</div>
{
renderComments()
}
</div> </div>
} }

View File

@ -2,8 +2,19 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
max-height: 30vh;
width: 100%;
padding: 10px; padding: 10px;
overflow-y: overlay;
border-radius: 12px;
color: var(--text-color); color: var(--text-color);
background-color: var(--background-color-primary);
transition: all 150ms ease-in-out;
h1, h1,
h2, h2,
@ -21,20 +32,13 @@
padding: 0px; padding: 0px;
} }
overflow: hidden; gap: 10px;
width: 100%;
//height: 100%;
transition: all 150ms ease-in-out;
.comment { .comment {
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: 10px;
background-color: var(--background-color-accent); background-color: var(--background-color-accent);
padding: 10px; padding: 10px;
@ -72,6 +76,9 @@
font-size: 14px; font-size: 14px;
color: var(--text-color); color: var(--text-color);
margin-left: 20px; margin-left: 20px;
word-break: break-all;
white-space: pre-wrap;
} }
.deleteBtn { .deleteBtn {
@ -87,17 +94,4 @@
} }
} }
} }
.commentCreatorWrapper {
position: sticky;
display: flex;
flex-direction: column;
align-items: center;
bottom: 0;
right: 0;
width: 100%;
}
} }