mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-27 10:33:56 +08:00
fix(related-threads): Show snippet in addition to subject #1683
This commit is contained in:
parent
9b34ce73ec
commit
244a28dffa
2 changed files with 13 additions and 3 deletions
|
@ -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>
|
||||
)
|
||||
})
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue