add component list-comments

This commit is contained in:
igoradamenko
2018-03-11 20:34:32 +03:00
parent 3c06e162a9
commit e4e432e209
4 changed files with 39 additions and 0 deletions
@@ -0,0 +1,5 @@
.list-comments__item {
&:last-child {
margin-bottom: 0;
}
}
@@ -0,0 +1,5 @@
export { default } from './list-comments';
require('./list-comments.scss');
require('./__item/list-comments__item.scss');
@@ -0,0 +1,25 @@
import { h, Component } from 'preact';
import { NODE_ID } from 'common/constants';
import Comment from 'components/comment';
export default class ListComments extends Component {
render({ comments = [] }, state) {
return (
<div id={NODE_ID}>
<div className="list-comments">
{
comments.map(comment => (
<Comment
data={comment}
mods={{ level: 0, guest: true }}
mix="list-comments__item"
/>
))
}
</div>
</div>
);
}
}
@@ -0,0 +1,4 @@
.list-comments {
position: relative;
font-family: 'PT Sans', Helvetica, Arial, sans-serif;
}