Add character cutoff on descriptions for featured and community content

This commit is contained in:
Alex Liebowitz 2016-07-27 06:25:26 -04:00
parent aa968e2b13
commit aff6308846

View file

@ -150,6 +150,8 @@ var featuredContentItemStyle = {
}; };
var FeaturedContentItem = React.createClass({ var FeaturedContentItem = React.createClass({
_maxDescriptionLength: 250,
propTypes: { propTypes: {
name: React.PropTypes.string, name: React.PropTypes.string,
}, },
@ -207,7 +209,8 @@ var FeaturedContentItem = React.createClass({
       
<DownloadLink streamName={this.props.name} /> <DownloadLink streamName={this.props.name} />
</div> </div>
<p style={featuredContentItemDescriptionStyle}>{metadata.description}</p> <p style={featuredContentItemDescriptionStyle}>{metadata.description.slice(0, this._maxDescriptionLength) +
(metadata.description.length > this._maxDescriptionLength ? ' ...' : '')}</p>
</div> </div>
</div>); </div>);
} }