_ = require 'underscore'
React = require 'react'
{Actions,
DOMUtils,
TaskFactory,
AccountStore,
FocusedPerspectiveStore} = require 'nylas-exports'
{RetinaImg} = require 'nylas-component-kit'
class ThreadTrashButton extends React.Component
@displayName: "ThreadTrashButton"
@containerRequired: false
@propTypes:
thread: React.PropTypes.object.isRequired
render: =>
allowed = FocusedPerspectiveStore.current().canMoveThreadsTo([@props.thread], 'trash')
return unless allowed
_onRemove: (e) =>
return unless DOMUtils.nodeIsVisible(e.currentTarget)
Actions.trashThreads({
source: "Toolbar Button: Thread List",
threads: [@props.thread],
})
Actions.popSheet()
e.stopPropagation()
module.exports = ThreadTrashButton