mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-23 00:36:50 +08:00
5b7ae0ad54
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
37 lines
1,000 B
CoffeeScript
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
|