diff --git a/client/coral-embed-stream/src/actions/comment.js b/client/coral-embed-stream/src/actions/comment.js index 574d66267..b48e29798 100644 --- a/client/coral-embed-stream/src/actions/comment.js +++ b/client/coral-embed-stream/src/actions/comment.js @@ -1,11 +1,11 @@ -import {ADD_CLASSNAME, REMOVE_CLASSNAME} from '../constants/comment'; +import {ADD_COMMENT_CLASSNAME, REMOVE_COMMENT_CLASSNAME} from '../constants/comment'; -export const addClassName = (className) => ({ - type: ADD_CLASSNAME, +export const addCommentClassName = (className) => ({ + type: ADD_COMMENT_CLASSNAME, className }); -export const removeClassName = (idx) => ({ - type: REMOVE_CLASSNAME, +export const removeCommentClassName = (idx) => ({ + type: REMOVE_COMMENT_CLASSNAME, idx }); diff --git a/client/coral-embed-stream/src/components/Comment.js b/client/coral-embed-stream/src/components/Comment.js index 84158e755..2a434c3d7 100644 --- a/client/coral-embed-stream/src/components/Comment.js +++ b/client/coral-embed-stream/src/components/Comment.js @@ -169,11 +169,11 @@ export default class Comment extends React.Component { activeReplyBox, addNotification, charCountEnable, - classNames = [], showSignInDialog, removeCommentTag, commentIsIgnored, setActiveReplyBox, + commentClassNames = [] } = this.props; const flagSummary = getActionSummary('FlagActionSummary', comment); @@ -237,7 +237,7 @@ export default class Comment extends React.Component { * This will add myClassName to comments tagged with STAFF TAG. * **/ - const classNamesToAdd = classNames.reduce((acc, className) => { + const classNamesToAdd = commentClassNames.reduce((acc, className) => { let res = []; // Adding classNames based on tags diff --git a/client/coral-embed-stream/src/components/Stream.js b/client/coral-embed-stream/src/components/Stream.js index d1b74b629..b99b23b70 100644 --- a/client/coral-embed-stream/src/components/Stream.js +++ b/client/coral-embed-stream/src/components/Stream.js @@ -25,7 +25,7 @@ class Stream extends React.Component { render() { const { - classNames, + commentClassNames, root: {asset, asset: {comments}, comment, me}, postComment, addNotification, @@ -158,7 +158,7 @@ class Stream extends React.Component { return commentIsIgnored(comment) ? : ({ assetUrl: state.stream.assetUrl, activeTab: state.embed.activeTab, previousTab: state.embed.previousTab, - classNames: state.comment.classNames + commentClassNames: state.comment.commentClassNames }); const mapDispatchToProps = (dispatch) => diff --git a/client/coral-embed-stream/src/reducers/comment.js b/client/coral-embed-stream/src/reducers/comment.js index e2cd43ee4..7cee8d3c8 100644 --- a/client/coral-embed-stream/src/reducers/comment.js +++ b/client/coral-embed-stream/src/reducers/comment.js @@ -1,22 +1,22 @@ -import {ADD_CLASSNAME, REMOVE_CLASSNAME} from '../constants/comment'; +import {ADD_COMMENT_CLASSNAME, REMOVE_COMMENT_CLASSNAME} from '../constants/comment'; const initialState = { - classNames: [] + commentClassNames: [] }; export default function comment (state = initialState, action) { switch (action.type) { - case ADD_CLASSNAME : + case ADD_COMMENT_CLASSNAME : return { ...state, - classNames: [...state.classNames, action.className] + commentClassNames: [...state.commentClassNames, action.className] }; - case REMOVE_CLASSNAME : + case REMOVE_COMMENT_CLASSNAME : return { ...state, - classNames: [ - ...state.classNames.slice(0, action.idx), - ...state.classNames.slice(action.idx + 1) + commentClassNames: [ + ...state.commentClassNames.slice(0, action.idx), + ...state.commentClassNames.slice(action.idx + 1) ] }; default : diff --git a/plugins/coral-plugin-offtopic/client/components/OffTopicFilter.js b/plugins/coral-plugin-offtopic/client/components/OffTopicFilter.js index 77e4362e2..ff451f9cb 100644 --- a/plugins/coral-plugin-offtopic/client/components/OffTopicFilter.js +++ b/plugins/coral-plugin-offtopic/client/components/OffTopicFilter.js @@ -9,11 +9,11 @@ export default class OffTopicFilter extends React.Component { handleChange = (e) => { if (e.target.checked) { - this.props.addClassName(this.cn); + this.props.addCommentClassName(this.cn); this.props.toggleCheckbox(); } else { - const idx = this.props.classNames.findIndex((i) => i[this.className]); - this.props.removeClassName(idx); + const idx = this.props.commentClassNames.findIndex((i) => i[this.className]); + this.props.removeCommentClassName(idx); this.props.toggleCheckbox(); } this.props.closeViewingOptions(); diff --git a/plugins/coral-plugin-offtopic/client/containers/OffTopicFilter.js b/plugins/coral-plugin-offtopic/client/containers/OffTopicFilter.js index a14c0f80c..f7fe114f3 100644 --- a/plugins/coral-plugin-offtopic/client/containers/OffTopicFilter.js +++ b/plugins/coral-plugin-offtopic/client/containers/OffTopicFilter.js @@ -2,24 +2,24 @@ import {connect} from 'react-redux'; import {bindActionCreators} from 'redux'; import {toggleCheckbox} from '../actions'; import { - addClassName, - removeClassName + addCommentClassName, + removeCommentClassName } from 'coral-embed-stream/src/actions/comment'; import OffTopicFilter from '../components/OffTopicFilter'; import {closeViewingOptions} from 'coral-embed-stream/src/actions/stream'; const mapStateToProps = ({comment, offTopic}) => ({ - classNames: comment.classNames, + commentClassNames: comment.commentClassNames, checked: offTopic.checked }); const mapDispatchToProps = (dispatch) => bindActionCreators( { - addClassName, - removeClassName, toggleCheckbox, - closeViewingOptions + closeViewingOptions, + addCommentClassName, + removeCommentClassName }, dispatch );