Mailspring/internal_packages/message-list/lib/message-toolbar-items.cjsx
Ben Gotow 5b7ae0ad54 feat(tags): Tags dropdown and new features for Menu and Popover
Summary:
Focused Content Store should notify observers when focused items change, not just when they're reassigned

Popovers should have a `direction` and optional event onOpened

Menu divider documentation was wrong, menus should support checked items by default

Pressing escape in a popover's input should dismiss the popover

Other changes

Remove specs that make no sense anymore

Small tweak to report build breaking. Shouldn't happen often ;)

Test Plan: Run tests, which will now phone home if they break

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1493
2015-05-13 12:01:41 -07:00

37 lines
1,000 B
CoffeeScript

_ = require 'underscore-plus'
React = require 'react'
classNames = require 'classnames'
{Actions, Utils, FocusedContentStore, WorkspaceStore} = require 'inbox-exports'
{RetinaImg, Popover, Menu} = require 'ui-components'
ThreadArchiveButton = require './thread-archive-button'
class MessageToolbarItems extends React.Component
@displayName: "MessageToolbarItems"
constructor: (@props) ->
@state =
threadIsSelected: FocusedContentStore.focusedId('thread')?
render: =>
classes = classNames
"message-toolbar-items": true
"hidden": !@state.threadIsSelected
<div className={classes}>
<ThreadArchiveButton />
</div>
componentDidMount: =>
@_unsubscribers = []
@_unsubscribers.push FocusedContentStore.listen @_onChange
componentWillUnmount: =>
unsubscribe() for unsubscribe in @_unsubscribers
_onChange: => _.defer =>
@setState
threadIsSelected: FocusedContentStore.focusedId('thread')?
module.exports = MessageToolbarItems