2017-03-23 16:27:59 +09:00
|
|
|
import { Components, registerComponent } from 'meteor/vulcan:core';
|
2016-04-14 10:12:35 +09:00
|
|
|
import React from 'react';
|
2016-12-08 23:48:16 +01:00
|
|
|
import { FormattedMessage } from 'react-intl';
|
2016-04-14 10:12:35 +09:00
|
|
|
|
2016-10-19 11:07:21 +02:00
|
|
|
const CommentsList = ({comments, commentCount}) => {
|
2016-04-14 10:12:35 +09:00
|
|
|
|
2016-11-07 18:03:07 +01:00
|
|
|
if (commentCount > 0) {
|
2016-04-14 10:12:35 +09:00
|
|
|
return (
|
|
|
|
<div className="comments-list">
|
2016-12-06 18:06:29 +01:00
|
|
|
{comments.map(comment => <Components.CommentsNode comment={comment} key={comment._id} />)}
|
|
|
|
{/*hasMore ? (ready ? <Components.CommentsLoadMore loadMore={loadMore} count={count} totalCount={totalCount} /> : <Components.Loading/>) : null*/}
|
2016-04-14 10:12:35 +09:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
return (
|
|
|
|
<div className="comments-list">
|
2016-06-09 17:42:20 +09:00
|
|
|
<p>
|
|
|
|
<FormattedMessage id="comments.no_comments"/>
|
|
|
|
</p>
|
2016-04-14 10:12:35 +09:00
|
|
|
</div>
|
2016-11-26 02:46:55 +08:00
|
|
|
)
|
2016-04-14 10:12:35 +09:00
|
|
|
}
|
2016-11-26 02:46:55 +08:00
|
|
|
|
2016-04-14 10:12:35 +09:00
|
|
|
};
|
|
|
|
|
2016-05-22 16:42:24 +09:00
|
|
|
CommentsList.displayName = "CommentsList";
|
|
|
|
|
2016-12-08 23:48:16 +01:00
|
|
|
registerComponent('CommentsList', CommentsList);
|