mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 12:40:08 +08:00
f88b0f3708
Summary: Fixes T3570 Fixes T3737 Rename ArchiveThreadHelper to RemoveThreadHelper Rename of `getRemovalTask` Remove unarchive from `RemoveThreadHelper`. Pass in mailviewfilter Rename actions Rename archive action renmaing support trash and archive folders in RemoveThreadHelper Move everything over to trash add tests Hide trash and archive Test Plan: new tests Reviewers: dillon, bengotow Reviewed By: dillon, bengotow Maniphest Tasks: T3570, T3737 Differential Revision: https://phab.nylas.com/D2089
37 lines
1.1 KiB
CoffeeScript
37 lines
1.1 KiB
CoffeeScript
_ = require 'underscore'
|
|
React = require 'react'
|
|
{Actions,
|
|
DOMUtils,
|
|
RemoveThreadHelper,
|
|
FocusedMailViewStore} = require 'nylas-exports'
|
|
{RetinaImg} = require 'nylas-component-kit'
|
|
|
|
class ThreadRemoveButton extends React.Component
|
|
@displayName: "ThreadRemoveButton"
|
|
@containerRequired: false
|
|
|
|
render: =>
|
|
focusedMailViewFilter = FocusedMailViewStore.mailView()
|
|
return false unless focusedMailViewFilter?.canRemoveThreads()
|
|
|
|
if RemoveThreadHelper.removeType() is RemoveThreadHelper.Type.Archive
|
|
tooltip = "Archive"
|
|
imgName = "toolbar-archive.png"
|
|
else if RemoveThreadHelper.removeType() is RemoveThreadHelper.Type.Trash
|
|
tooltip = "Trash"
|
|
imgName = "toolbar-trash.png"
|
|
|
|
<button className="btn btn-toolbar"
|
|
style={order: -106}
|
|
data-tooltip={tooltip}
|
|
onClick={@_onRemove}>
|
|
<RetinaImg name={imgName} mode={RetinaImg.Mode.ContentIsMask}/>
|
|
</button>
|
|
|
|
_onRemove: (e) =>
|
|
return unless DOMUtils.nodeIsVisible(e.currentTarget)
|
|
Actions.removeCurrentlyFocusedThread()
|
|
e.stopPropagation()
|
|
|
|
|
|
module.exports = ThreadRemoveButton
|