fix(related-threads): Show snippet in addition to subject #1683

This commit is contained in:
Ben Gotow 2016-04-14 17:33:43 -04:00
parent 9b34ce73ec
commit 244a28dffa
2 changed files with 13 additions and 3 deletions

View file

@ -50,11 +50,17 @@ export default class RelatedThreads extends React.Component {
const height = ((limit + (this._hasToggle() ? 1 : 0)) * 31);
const shownThreads = this.props.contactThreads.slice(0, limit)
const threads = shownThreads.map((thread) => {
const {snippet, subject, lastMessageReceivedTimestamp} = thread;
const snippetStyles = (subject && subject.length) ? {marginLeft: '1em'} : {};
const onClick = () => { this._onClick(thread) }
return (
<div key={thread.id} className="related-thread" onClick={onClick} >
<span className="subject" title={thread.subject}>{thread.subject}</span>
<span className="timestamp" title={Utils.fullTimeString(thread.lastMessageReceivedTimestamp)}>{Utils.shortTimeString(thread.lastMessageReceivedTimestamp)}</span>
<span className="content" title={subject}>
{subject}
<span className="snippet" style={snippetStyles}>{snippet}</span>
</span>
<span className="timestamp" title={Utils.fullTimeString(lastMessageReceivedTimestamp)}>{Utils.shortTimeString(lastMessageReceivedTimestamp)}</span>
</div>
)
})

View file

@ -24,12 +24,16 @@
background: darken(#f9fcfe, 5%);
}
.subject {
.content {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-right: 1em;
.snippet {
opacity: 0.5;
}
}
}