Mailspring/internal_packages/message-list/lib/message-subject-item.cjsx
Ben Gotow 91edef9f7a fix(naming): Move atom/inbox/nilas refs to Nylas
Conflicts:
	internal_packages/inbox-activity-bar/lib/activity-bar-long-poll-item.cjsx
2015-05-15 11:07:28 -07:00

26 lines
674 B
CoffeeScript

_ = require 'underscore-plus'
React = require 'react'
{FocusedContentStore} = require 'nylas-exports'
class MessageSubjectItem extends React.Component
@displayName: 'MessageSubjectItem'
constructor: (@props) ->
@state = @_getStateFromStores()
componentDidMount: =>
@_unsubscriber = FocusedContentStore.listen @_onChange
componentWillUnmount: =>
@_unsubscriber() if @_unsubscriber
render: =>
<div className="message-toolbar-subject">{@state.thread?.subject}</div>
_onChange: => _.defer =>
@setState(@_getStateFromStores())
_getStateFromStores: =>
thread: FocusedContentStore.focused('thread')
module.exports = MessageSubjectItem