diff --git a/client/coral-embed-stream/src/actions/comment.js b/client/coral-embed-stream/src/actions/comment.js new file mode 100644 index 000000000..574d66267 --- /dev/null +++ b/client/coral-embed-stream/src/actions/comment.js @@ -0,0 +1,11 @@ +import {ADD_CLASSNAME, REMOVE_CLASSNAME} from '../constants/comment'; + +export const addClassName = (className) => ({ + type: ADD_CLASSNAME, + className +}); + +export const removeClassName = (idx) => ({ + type: REMOVE_CLASSNAME, + idx +}); diff --git a/client/coral-embed-stream/src/components/Comment.js b/client/coral-embed-stream/src/components/Comment.js index d8410becd..3b8b8b08d 100644 --- a/client/coral-embed-stream/src/components/Comment.js +++ b/client/coral-embed-stream/src/components/Comment.js @@ -1,4 +1,6 @@ import React, {PropTypes} from 'react'; +import {connect} from 'react-redux'; +import cn from 'classnames'; import PermalinkButton from 'coral-plugin-permalinks/PermalinkButton'; import AuthorName from 'coral-plugin-author-name/AuthorName'; @@ -19,7 +21,6 @@ import Slot from 'coral-framework/components/Slot'; import LoadMore from './LoadMore'; import IgnoredCommentTombstone from './IgnoredCommentTombstone'; import {TopRightMenu} from './TopRightMenu'; -import classnames from 'classnames'; import {EditableCommentContent} from './EditableCommentContent'; import {getActionSummary, iPerformedThisAction} from 'coral-framework/utils'; import {getEditableUntilDate} from './util'; @@ -151,28 +152,29 @@ class Comment extends React.Component { } render () { const { - comment, - parentId, - currentUser, asset, depth, - postComment, - addNotification, - showSignInDialog, - highlighted, + comment, postFlag, - postDontAgree, + parentId, loadMore, - setActiveReplyBox, - activeReplyBox, - deleteAction, - addCommentTag, - removeCommentTag, ignoreUser, + highlighted, + postComment, + currentUser, + deleteAction, disableReply, - commentIsIgnored, maxCharCount, - charCountEnable + postDontAgree, + addCommentTag, + activeReplyBox, + addNotification, + charCountEnable, + classNames = [], + showSignInDialog, + removeCommentTag, + commentIsIgnored, + setActiveReplyBox, } = this.props; const flagSummary = getActionSummary('FlagActionSummary', comment); @@ -226,7 +228,7 @@ class Comment extends React.Component { return (
@@ -265,17 +267,17 @@ class Comment extends React.Component { (comment.user.id === currentUser.id)) /* User can edit/delete their own comment for a short window after posting */ - ? + ? { commentIsStillEditable(comment) && Edit } /* TopRightMenu allows currentUser to ignore other users' comments */ - : + : ({classNames: comment.classNames}); + +export default connect(mapStateToProps, null)(Comment); // return whether the comment is editable function commentIsStillEditable (comment) { diff --git a/client/coral-embed-stream/src/components/ViewingOptions.css b/client/coral-embed-stream/src/components/ViewingOptions.css index 45c45c00c..ba9de723b 100644 --- a/client/coral-embed-stream/src/components/ViewingOptions.css +++ b/client/coral-embed-stream/src/components/ViewingOptions.css @@ -10,6 +10,8 @@ background: white; position: absolute; box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.15); + right: 3px; + top: 20px; } .streamViewingOptionsList ul, .streamViewingOptionsList li { diff --git a/client/coral-embed-stream/src/components/ViewingOptions.js b/client/coral-embed-stream/src/components/ViewingOptions.js index 70b637759..d0fdeaf5b 100644 --- a/client/coral-embed-stream/src/components/ViewingOptions.js +++ b/client/coral-embed-stream/src/components/ViewingOptions.js @@ -24,7 +24,7 @@ export default class ViewingOptions extends React.Component { Viewing Options
{ - this.state.open ? ( + true ? (