Mailspring/internal_packages/message-list/lib/message-subject-item.cjsx
Evan Morikawa 4619871e8d refactor(utils): switch to regular underscore
Summary:
Fixes: T1334

remove final InboxApp references

move out all underscore-plus methods

Mass find and replace of underscore-plus

sed -i '' -- 's/underscore-plus/underscore/g' **/*.coffee
sed -i '' -- 's/underscore-plus/underscore/g' **/*.cjsx

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1534
2015-05-19 16:06:59 -07:00

26 lines
669 B
CoffeeScript

_ = require 'underscore'
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