Finalized styling
This commit is contained in:
parent
90d2f365c1
commit
69cb2b8be8
2 changed files with 60 additions and 11 deletions
|
@ -14,6 +14,7 @@ type CommentProps = {
|
|||
claimId: string,
|
||||
author: string,
|
||||
message: string,
|
||||
parentId: number,
|
||||
timePosted: number,
|
||||
};
|
||||
|
||||
|
@ -45,6 +46,7 @@ class CommentList extends React.PureComponent<CommentListProps> {
|
|||
commentId={comment.comment_id}
|
||||
key={comment.author + comment.comment_id}
|
||||
message={comment.message}
|
||||
parentId={comment.parent_id}
|
||||
timePosted={comment.time_posted}
|
||||
/>
|
||||
);
|
||||
|
@ -57,10 +59,10 @@ class CommentList extends React.PureComponent<CommentListProps> {
|
|||
class Comment extends React.PureComponent<CommentProps> {
|
||||
render() {
|
||||
return (
|
||||
<li className="comment">
|
||||
<li className={this.props.parentId ? 'comment reply' : 'comment'}>
|
||||
<div className="comment__meta card__actions--between">
|
||||
<div>{this.props.author}</div>
|
||||
<time datatime={this.props.timePosted}>{relativeDate(this.props.timePosted)}</time>
|
||||
<strong>{this.props.author}</strong>
|
||||
<time dateTime={this.props.timePosted}>{relativeDate(this.props.timePosted)}</time>
|
||||
</div>
|
||||
|
||||
<div className="comment__content">{this.props.message}</div>
|
||||
|
@ -68,9 +70,9 @@ class Comment extends React.PureComponent<CommentProps> {
|
|||
<div className="comment__actions card__actions--between">
|
||||
<button className={'button button--primary'}>Reply</button>
|
||||
|
||||
<span>
|
||||
<button className="comment__action button button--secondary">Up</button>
|
||||
<button className="comment__action button button--secondary">Down</button>
|
||||
<span className="comment__actions-wrap">
|
||||
<button className="comment__action upvote">Up</button>
|
||||
<button className="comment__action downvote">Down</button>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
@ -1,20 +1,67 @@
|
|||
.comments {
|
||||
}
|
||||
|
||||
.comment {
|
||||
padding-bottom: var(--spacing-vertical-large);
|
||||
|
||||
&.reply {
|
||||
border-left: 3px solid var(--lbry-teal-5);
|
||||
padding-left: var(--spacing-vertical-large);
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
&:not(:first-of-type) {
|
||||
padding-top: var(--spacing-vertical-large);
|
||||
}
|
||||
|
||||
&:not(:last-of-type) {
|
||||
border-bottom: 1px solid $lbry-gray-1;
|
||||
border-bottom: 1px solid var(--lbry-gray-1);
|
||||
|
||||
[data-mode='dark'] & {
|
||||
border-color: rgba($lbry-gray-5, 0.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.comment__actions-wrap {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 4.5rem;
|
||||
}
|
||||
|
||||
.comment__action {
|
||||
@include hide-text;
|
||||
width: 0; height: 0;
|
||||
transition: border-color 0.2s;
|
||||
|
||||
&.downvote {
|
||||
border-top: 2rem solid var(--lbry-orange-3);
|
||||
border-right: 1rem solid transparent;
|
||||
border-left: 1rem solid transparent;
|
||||
|
||||
&:hover {
|
||||
border-top-color: var(--lbry-yellow-3);
|
||||
}
|
||||
}
|
||||
|
||||
&.upvote {
|
||||
border-right: 1rem solid transparent;
|
||||
border-bottom: 2rem solid var(--lbry-teal-4);
|
||||
border-left: 1rem solid transparent;
|
||||
|
||||
&:hover {
|
||||
border-bottom-color: var(--lbry-green-2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.comment__content {
|
||||
font-size: 1.15rem;
|
||||
padding-top: var(--spacing-vertical-medium);
|
||||
padding-bottom: var(--spacing-vertical-medium);
|
||||
padding-bottom: var(--spacing-vertical-large);
|
||||
}
|
||||
|
||||
.comment__meta {
|
||||
time {
|
||||
opacity: 0.3;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue