Mailspring/internal_packages/message-list/lib/message-toolbar-items.cjsx
Evan Morikawa b89fea38c0 feat(labels): add a new label/folder picker
Summary:
This is the initial diff for the label picker UI. This is all of the
functionality and none of the CSS.

Test Plan: todo

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: sdw

Differential Revision: https://phab.nylas.com/D1761
2015-07-21 14:20:15 -07:00

43 lines
1,019 B
CoffeeScript

_ = require 'underscore'
React = require 'react'
classNames = require 'classnames'
{Actions,
WorkspaceStore,
FocusedContentStore} = require 'nylas-exports'
{Menu,
Popover,
RetinaImg,
InjectedComponentSet} = require 'nylas-component-kit'
class MessageToolbarItems extends React.Component
@displayName: "MessageToolbarItems"
constructor: (@props) ->
@state =
thread: FocusedContentStore.focused('thread')
render: =>
classes = classNames
"message-toolbar-items": true
"hidden": !@state.thread
<div className={classes}>
<InjectedComponentSet matching={role: "message:Toolbar"}
exposedProps={thread: @state.thread}/>
</div>
componentDidMount: =>
@_unsubscribers = []
@_unsubscribers.push FocusedContentStore.listen @_onChange
componentWillUnmount: =>
unsubscribe() for unsubscribe in @_unsubscribers
_onChange: =>
@setState
thread: FocusedContentStore.focused('thread')
module.exports = MessageToolbarItems