Search: Conditionally display hashtag features, fixes #142

merge-requests/59/head
Alex Gleason 4 years ago
parent 71a980bf81
commit d772608df4
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

@ -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…
Cancel
Save