Mailspring/src/components/list-narrow-item.cjsx
Ben Gotow 343e592569 feat(draft-list) Refactor thread-list, create draft-list
Summary: Adds the draft list using a refactored list-tabular class. Also fixes several draft bugs that appeared after allowing editing.

Test Plan: Run tests (need to test new ListTabular component ASAP)

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1272
2015-03-09 18:25:53 -07:00

42 lines
1.4 KiB
CoffeeScript

_ = require 'underscore-plus'
React = require 'react/addons'
{ComponentRegistry} = require 'inbox-exports'
ThreadListItemMixin = require './thread-list-item-mixin.cjsx'
DefaultParticipants = React.createClass
render: ->
<div className="participants">
{_.pluck(@props.participants, "email").join ", "}
</div>
module.exports =
ThreadListNarrowItem = React.createClass
mixins: [ComponentRegistry.Mixin, ThreadListItemMixin]
displayName: 'ThreadListNarrowItem'
components: ["Participants"]
render: ->
Participants = @state.Participants ? DefaultParticipants
<div className={@_containerClasses()} onClick={@_onClick} id={@props.thread.id}>
<div className="thread-title">
<span className="btn-icon star-button pull-right"
onClick={@_toggleStar}
><i className={"fa " + (@_isStarred() and 'fa-star' or 'fa-star-o')}/></span>
<div className="message-time">
{@threadTime()}
</div>
<Participants participants={@props.thread.participants} context={'list'} clickable={false}/>
</div>
<div className="preview-body">
<span className="subject">{@_subject()}</span>
<span className="snippet">{@_snippet()}</span>
</div>
</div>
_containerClasses: ->
React.addons.classSet
'unread': @props.unread
'selected': @props.selected
'thread-list-item': true
'thread-list-narrow-item': true