diff --git a/client/coral-embed-stream/src/Embed.js b/client/coral-embed-stream/src/Embed.js index 4df0290ac..aa4223757 100644 --- a/client/coral-embed-stream/src/Embed.js +++ b/client/coral-embed-stream/src/Embed.js @@ -1,4 +1,4 @@ -import React, {Component} from 'react'; +import React from 'react'; import {compose} from 'react-apollo'; import {connect} from 'react-redux'; import isEqual from 'lodash/isEqual'; @@ -36,9 +36,18 @@ import HighlightedComment from './Comment'; import LoadMore from './LoadMore'; import NewCount from './NewCount'; -class Embed extends Component { +class Embed extends React.Component { - state = {activeTab: 0, showSignInDialog: false, activeReplyBox: ''}; + constructor(props) { + super(props); + this.state = { + activeTab: 0, + showSignInDialog: + false, activeReplyBox: '' + }; + + this.handleClick = this.handleClick.bind(this); + } changeTab = (tab) => { const {isAdmin} = this.props.auth; @@ -114,6 +123,11 @@ class Embed extends Component { } } + handleClick() { + this.props.viewAllComments(); + this.props.data.refetch(); + } + render () { const {activeTab} = this.state; const {closedAt, countCache = {}} = this.props.asset; @@ -146,10 +160,7 @@ class Embed extends Component { { - this.props.viewAllComments(); - this.props.data.refetch(); - }}/> + handleClick={this.handleClick}/> {lang.t('MY_COMMENTS')} Configure Stream diff --git a/client/coral-plugin-comment-count/CommentCount.js b/client/coral-plugin-comment-count/CommentCount.js index e53944025..be38d1425 100644 --- a/client/coral-plugin-comment-count/CommentCount.js +++ b/client/coral-plugin-comment-count/CommentCount.js @@ -3,8 +3,8 @@ import {I18n} from '../coral-framework'; import translations from './translations.json'; const name = 'coral-plugin-comment-count'; -const CommentCount = ({count, onClick}) => { - return
onClick()}> +const CommentCount = ({count, handleClick}) => { + return
{`${count} ${count === 1 ? lang.t('comment') : lang.t('comment-plural')}`}
; };