{RetinaImg} = require 'nylas-component-kit'
{Actions,
React,
TaskFactory,
DOMUtils,
AccountStore,
FocusedPerspectiveStore} = require 'nylas-exports'
class ThreadArchiveButton extends React.Component
@displayName: "ThreadArchiveButton"
@containerRequired: false
@propTypes:
thread: React.PropTypes.object.isRequired
render: =>
canArchiveThreads = FocusedPerspectiveStore.current().canArchiveThreads([@props.thread])
return unless canArchiveThreads
_onArchive: (e) =>
return unless DOMUtils.nodeIsVisible(e.currentTarget)
tasks = TaskFactory.tasksForArchiving
threads: [@props.thread]
source: "Toolbar Button: Message List"
Actions.queueTasks(tasks)
Actions.popSheet()
e.stopPropagation()
module.exports = ThreadArchiveButton