mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-29 11:52:34 +08:00
237bad59d8
Summary: Adds a new unified "Spam" folder and a unified "Unread" view, which shows all the messages in your inbox which are unread. Test Plan: Run tests Reviewers: evan, juan Reviewed By: juan Differential Revision: https://phab.nylas.com/D2901
37 lines
1,014 B
CoffeeScript
37 lines
1,014 B
CoffeeScript
_ = 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 <span /> unless allowed
|
|
|
|
<button className="btn btn-toolbar"
|
|
style={order: -106}
|
|
title="Move to Trash"
|
|
onClick={@_onRemove}>
|
|
<RetinaImg name="toolbar-trash.png" mode={RetinaImg.Mode.ContentIsMask}/>
|
|
</button>
|
|
|
|
_onRemove: (e) =>
|
|
return unless DOMUtils.nodeIsVisible(e.currentTarget)
|
|
tasks = TaskFactory.tasksForMovingToTrash
|
|
threads: [@props.thread]
|
|
Actions.queueTasks(tasks)
|
|
Actions.popSheet()
|
|
e.stopPropagation()
|
|
|
|
|
|
module.exports = ThreadTrashButton
|