mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
ef9a1b1164
This reverts commit a8fbcb0c93
.
# Conflicts:
# packages/client-app/internal_packages/thread-list/lib/thread-list-quick-actions.cjsx
# packages/client-app/internal_packages/thread-list/lib/thread-list.cjsx
# packages/client-app/src/flux/actions.es6
# packages/client-app/src/flux/stores/thread-list-actions-store.es6
# packages/client-app/src/global/nylas-exports.es6
# packages/isomorphic-core/src/metrics-reporter.es6
36 lines
1 KiB
CoffeeScript
36 lines
1 KiB
CoffeeScript
{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 <span /> unless canArchiveThreads
|
|
|
|
<button className="btn btn-toolbar btn-archive"
|
|
style={order: -107}
|
|
title="Archive"
|
|
onClick={@_onArchive}>
|
|
<RetinaImg name="toolbar-archive.png" mode={RetinaImg.Mode.ContentIsMask}/>
|
|
</button>
|
|
|
|
_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
|