Stream is a separate component that renders comments

This commit is contained in:
Riley Davis
2017-01-20 12:41:33 -07:00
parent d14fa33077
commit 8f95e29315
2 changed files with 22 additions and 6 deletions
+2 -6
View File
@@ -11,7 +11,7 @@ import {
authActions
} from '../../coral-framework';
import Comment from './Comment';
import Stream from './Stream';
import CommentBox from '../../coral-plugin-commentbox/CommentBox';
import InfoBox from '../../coral-plugin-infobox/InfoBox';
@@ -156,11 +156,7 @@ class Embed extends Component {
refetch={refetch}
showSignInDialog={showSignInDialog}/>
}
{
asset.comments.map(comment => {
return <Comment key={comment.id} comment={comment} />;
})
}
<Stream comments={asset.comments} />
{
<Notification
notifLength={4500}
+20
View File
@@ -0,0 +1,20 @@
import React, {Component, PropTypes} from 'react';
import Comment from './Comment';
const Stream = ({comments}) => {
return (
<div>
{
comments.map(comment => {
return <Comment key={comment.id} comment={comment} />;
})
}
</div>
);
};
Stream.propTypes = {
comments: PropTypes.array.isRequired
};
export default Stream;