From d724351fb66697df9e544c8d5541d844aa0ac0c4 Mon Sep 17 00:00:00 2001 From: Riley Davis Date: Fri, 20 Jan 2017 15:54:18 -0700 Subject: [PATCH] merge my changes --- client/coral-embed-stream/src/Comment.js | 48 ++++++++++++++++++++++-- client/coral-embed-stream/src/Embed.js | 29 ++++++-------- client/coral-embed-stream/src/Stream.js | 16 ++++++-- 3 files changed, 70 insertions(+), 23 deletions(-) diff --git a/client/coral-embed-stream/src/Comment.js b/client/coral-embed-stream/src/Comment.js index 71fe3723f..0d19d7b30 100644 --- a/client/coral-embed-stream/src/Comment.js +++ b/client/coral-embed-stream/src/Comment.js @@ -8,18 +8,60 @@ import React, {PropTypes} from 'react'; import PermalinkButton from 'coral-plugin-permalinks/PermalinkButton'; +import AuthorName from '../../coral-plugin-author-name/AuthorName'; +import Content from '../../coral-plugin-commentcontent/CommentContent'; +import PubDate from '../../coral-plugin-pubdate/PubDate'; +import {ReplyBox, ReplyButton} from '../../coral-plugin-replies'; +import FlagComment from '../../coral-plugin-flags/FlagComment'; +import LikeButton from '../../coral-plugin-likes/LikeButton'; -const Comment = ({comment}) => { +const Comment = ({comment, currentUser, asset}) => { + console.log('A Comment', comment); + console.log('the asset', asset); return (

- {comment.body} - + {/**/} + + +
+ +
+
+ + +
+ { + comment.replies.map(reply => { + return ; + }) + } +
); }; Comment.propTypes = { + asset: PropTypes.shape({ + id: PropTypes.string, + title: PropTypes.string, + url: PropTypes.string + }).isRequired, + currentUser: PropTypes.object, comment: PropTypes.shape({ depth: PropTypes.number, actions: PropTypes.array.isRequired, diff --git a/client/coral-embed-stream/src/Embed.js b/client/coral-embed-stream/src/Embed.js index 87da4271c..173c12164 100644 --- a/client/coral-embed-stream/src/Embed.js +++ b/client/coral-embed-stream/src/Embed.js @@ -23,12 +23,6 @@ import InfoBox from 'coral-plugin-infobox/InfoBox'; // import PubDate from '../../coral-plugin-pubdate/PubDate'; import Count from 'coral-plugin-comment-count/CommentCount'; -// import AuthorName from '../../coral-plugin-author-name/AuthorName'; -// import {ReplyBox, ReplyButton} from '../../coral-plugin-replies'; -// import FlagComment from '../../coral-plugin-flags/FlagComment'; -// import LikeButton from '../../coral-plugin-likes/LikeButton'; -// import PermalinkButton from '../../coral-plugin-permalinks/PermalinkButton'; - import SignInContainer from '../../coral-sign-in/containers/SignInContainer'; import UserBox from '../../coral-sign-in/components/UserBox'; @@ -94,6 +88,7 @@ class Embed extends Component { // } // }, 100); // }); + } render () { @@ -155,12 +150,17 @@ class Embed extends Component { refetch={refetch} showSignInDialog={showSignInDialog}/> } - - + + { + + } ({ dispatch: d => dispatch(d) }); -// Initialize GraphQL queries or mutations with the `gql` tag -const pym = new Pym.Child({polling: 100}); - -let url = pym.parentUrl; - export default compose( connect(mapStateToProps, mapDispatchToProps), postComment, diff --git a/client/coral-embed-stream/src/Stream.js b/client/coral-embed-stream/src/Stream.js index 61cfcd29d..999cfbd94 100644 --- a/client/coral-embed-stream/src/Stream.js +++ b/client/coral-embed-stream/src/Stream.js @@ -1,12 +1,17 @@ import React, {PropTypes} from 'react'; import Comment from './Comment'; -const Stream = ({comments}) => { +const Stream = ({comments, currentUser, asset}) => { + console.log('currentUser', currentUser); return (
{ comments.map(comment => { - return ; + return ; }) }
@@ -14,7 +19,12 @@ const Stream = ({comments}) => { }; Stream.propTypes = { - comments: PropTypes.array.isRequired + asset: PropTypes.object.isRequired, + comments: PropTypes.array.isRequired, + currentUser: PropTypes.shape({ + displayName: PropTypes.string, + id: PropTypes.string + }) }; export default Stream;