Adds click to showAll and refresh query to the '# comments' tab.

This commit is contained in:
gaba
2017-04-11 15:02:04 -07:00
parent 4ce37a4bbb
commit 56dedb551f
2 changed files with 9 additions and 3 deletions
+7 -1
View File
@@ -144,7 +144,13 @@ class Embed extends Component {
<div style={expandForLogin}>
<div className="commentStream">
<TabBar onChange={this.changeTab} activeTab={activeTab}>
<Tab><Count count={asset.totalCommentCount}/></Tab>
<Tab><Count
count={asset.totalCommentCount}
onClick={()=> {
this.props.viewAllComments();
this.props.data.refetch();
}}/>
</Tab>
<Tab>{lang.t('MY_COMMENTS')}</Tab>
<Tab restricted={!isAdmin}>Configure Stream</Tab>
</TabBar>
@@ -3,8 +3,8 @@ import {I18n} from '../coral-framework';
import translations from './translations.json';
const name = 'coral-plugin-comment-count';
const CommentCount = ({count}) => {
return <div className={`${name}-text`}>
const CommentCount = ({count, onClick}) => {
return <div className={`${name}-text`} onClick={() => onClick()}>
{`${count} ${count === 1 ? lang.t('comment') : lang.t('comment-plural')}`}
</div>;
};