Search: Conditionally display hashtag features, fixes #142
This commit is contained in:
parent
71a980bf81
commit
d772608df4
3 changed files with 6 additions and 6 deletions
|
@ -12,16 +12,16 @@ const Hashtag = ({ hashtag }) => (
|
|||
#<span>{hashtag.get('name')}</span>
|
||||
</Permalink>
|
||||
|
||||
<div className='trends__item__count'>
|
||||
{hashtag.get('history') && <div className='trends__item__count'>
|
||||
<FormattedMessage id='trends.count_by_accounts' defaultMessage='{count} {rawCount, plural, one {person} other {people}} talking' values={{ rawCount: hashtag.getIn(['history', 0, 'accounts']), count: <strong>{shortNumberFormat(hashtag.getIn(['history', 0, 'accounts']))}</strong> }} />
|
||||
</div>
|
||||
</div>}
|
||||
</div>
|
||||
|
||||
<div className='trends__item__sparkline'>
|
||||
{hashtag.get('history') && <div className='trends__item__sparkline'>
|
||||
<Sparklines width={50} height={28} data={hashtag.get('history').reverse().map(day => day.get('uses')).toArray()}>
|
||||
<SparklinesCurve style={{ fill: 'none' }} />
|
||||
</Sparklines>
|
||||
</div>
|
||||
</div>}
|
||||
</div>
|
||||
);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ class SearchResults extends ImmutablePureComponent {
|
|||
|
||||
static propTypes = {
|
||||
results: ImmutablePropTypes.map.isRequired,
|
||||
features: PropTypes.node,
|
||||
features: PropTypes.object,
|
||||
intl: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ const SearchPage = ({ children, features }) => (
|
|||
|
||||
SearchPage.propTypes = {
|
||||
children: PropTypes.node,
|
||||
features: PropTypes.node,
|
||||
features: PropTypes.object,
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(SearchPage);
|
||||
|
|
Loading…
Reference in a new issue