Commit a40915c6 authored by Matthew Taylor's avatar Matthew Taylor

use ellipsis if text overflows and urlify username

fixes #103 and #113
parent 41770ad5
......@@ -26,20 +26,30 @@ var Thumbnail = React.createClass({
);
var extra = [];
if (this.props.creator) {
extra.push(<div key="creator" className="thumbnail-creator">by {this.props.creator}</div>);
extra.push(
<div key="creator" className="thumbnail-creator">
by <a href={'/users/' + this.props.creator + '/'}>{this.props.creator}</a>
</div>
);
}
if (this.props.loves && this.props.showLoves) {
extra.push(
<div key="loves" className="thumbnail-loves"
<div
key="loves"
className="thumbnail-loves"
title={this.props.loves + ' loves'}>
{this.props.loves}
</div>
);
}
if (this.props.remixes && this.props.showRemixes) {
extra.push(
<div key="remixes" className="thumbnail-remixes"
<div
key="remixes"
className="thumbnail-remixes"
title={this.props.remixes + ' remixes'}>
{this.props.remixes}
</div>
);
......@@ -49,7 +59,9 @@ var Thumbnail = React.createClass({
<a className="thumbnail-image" href={this.props.href}>
<img src={this.props.src} />
</a>
<div className="thumbnail-title"><a href={this.props.href}>{this.props.title}</a></div>
<div className="thumbnail-title">
<a href={this.props.href}>{this.props.title}</a>
</div>
{extra}
</div>
);
......
......@@ -16,12 +16,6 @@
#{$extras} {
line-height: normal;
word-wrap: break-word;
}
.thumbnail-title {
margin-bottom: 1px;
font-size: .9230em;
font-weight: 800;
a {
display: block;
......@@ -31,6 +25,12 @@
}
}
.thumbnail-title {
margin-bottom: 1px;
font-size: .9230em;
font-weight: 800;
}
#{$extras} {
color: $type-gray;
font-size: .8462em;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment