mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
28692ff5af
Summary: Adding star button to message-toolbar view Test Plan: Added spec for starring message from the message-toolbar view Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D1683
38 lines
1 KiB
CoffeeScript
38 lines
1 KiB
CoffeeScript
_ = require 'underscore'
|
|
React = require 'react'
|
|
classNames = require 'classnames'
|
|
{Actions, Utils, FocusedContentStore, WorkspaceStore} = require 'nylas-exports'
|
|
{RetinaImg, Popover, Menu} = require 'nylas-component-kit'
|
|
|
|
ThreadArchiveButton = require './thread-archive-button'
|
|
ThreadStarButton = require './thread-star-button'
|
|
|
|
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}>
|
|
<ThreadArchiveButton />
|
|
<ThreadStarButton ref="starButton" 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
|