mirror of
https://github.com/vale981/Vulcan
synced 2025-03-12 13:36:37 -04:00
21 lines
718 B
React
21 lines
718 B
React
![]() |
import { Components, registerComponent } from 'meteor/vulcan:core';
|
||
|
import React, { PureComponent } from 'react';
|
||
|
import PropTypes from 'prop-types';
|
||
|
|
||
|
const CommentsNode = ({ comment, currentUser }) =>
|
||
|
<div className="comments-node">
|
||
|
<Components.CommentsItem currentUser={currentUser} comment={comment} key={comment._id} />
|
||
|
{comment.childrenResults ?
|
||
|
<div className="comments-children">
|
||
|
{comment.childrenResults.map(comment => <CommentsNode currentUser={currentUser} comment={comment} key={comment._id} />)}
|
||
|
</div>
|
||
|
: null
|
||
|
}
|
||
|
</div>
|
||
|
|
||
|
CommentsNode.propTypes = {
|
||
|
comment: PropTypes.object.isRequired, // the current comment
|
||
|
};
|
||
|
|
||
|
registerComponent('CommentsNode', CommentsNode);
|