merge my changes

This commit is contained in:
Riley Davis
2017-01-20 15:54:18 -07:00
parent 450d74848e
commit d724351fb6
3 changed files with 70 additions and 23 deletions
+45 -3
View File
@@ -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 (
<div className="comment" id={`c_${comment.id}`}>
<hr aria-hidden={true} />
{comment.body}
<PermalinkButton articleUrl={'some string'} commentId={comment.id} />
{/*<AuthorName
author={comment.user}
addNotification={this.props.addNotification}
id={comment.id}
author_id={comment.user.id}
postAction={this.props.postAction}
showSignInDialog={this.props.showSignInDialog}
deleteAction={this.props.deleteAction}
addItem={this.props.addItem}
updateItem={this.props.updateItem}
currentUser={currentUser}/>*/}
<PubDate created_at={comment.created_at} />
<Content body={comment.body} />
<div className="commentActionsLeft">
</div>
<div className="commentActionsRight">
<PermalinkButton articleURL={asset.url} commentId={comment.id} />
</div>
{
comment.replies.map(reply => {
return <Comment
asset={asset}
currentUser={currentUser}
key={reply.id}
comment={reply} />;
})
}
</div>
);
};
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,
+12 -17
View File
@@ -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}/>
}
<Stream comments={asset.comments} />
<Notification
notifLength={4500}
clearNotification={this.props.clearNotification}
notification={{text: null}}
/>
<Stream
asset={asset}
currentUser={currentUser}
comments={asset.comments} />
{
<Notification
notifLength={4500}
clearNotification={this.props.clearNotification}
notification={{text: null}}
/>
}
</TabContent>
<TabContent show={activeTab === 1}>
<SettingsContainer
@@ -214,11 +214,6 @@ const mapDispatchToProps = dispatch => ({
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,
+13 -3
View File
@@ -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 (
<div>
{
comments.map(comment => {
return <Comment key={comment.id} comment={comment} />;
return <Comment
asset={asset}
currentUser={currentUser}
key={comment.id}
comment={comment} />;
})
}
</div>
@@ -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;