Hide featured comments tab when empty

This commit is contained in:
Chi Vinh Le
2017-07-20 02:07:40 +07:00
parent 84edd8c6c2
commit 673f0cd232
2 changed files with 27 additions and 10 deletions
@@ -1,5 +1,5 @@
import {compose, gql} from 'react-apollo';
import {withFragments} from 'plugin-api/beta/client/hocs';
import {withFragments, excludeIf} from 'plugin-api/beta/client/hocs';
import Tab from '../components/Tab';
const enhance = compose(
@@ -9,6 +9,7 @@ const enhance = compose(
featuredCommentsCount: totalCommentCount(tags: ["FEATURED"], excludeIgnored: $excludeIgnored)
}`,
}),
excludeIf((props) => props.asset.featuredCommentsCount === 0),
);
export default enhance(Tab);