Mailspring/internal_packages/thread-list/lib/thread-list-quick-actions.cjsx
Evan Morikawa f88b0f3708 feat(archive): shows trash for non-archive accounts
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
2015-09-30 19:51:48 -07:00

33 lines
975 B
CoffeeScript

React = require 'react'
{Actions,
RemoveThreadHelper,
FocusedMailViewStore} = require 'nylas-exports'
class ThreadListQuickActions extends React.Component
@displayName: 'ThreadListQuickActions'
@propTypes:
thread: React.PropTypes.object
render: =>
focusedMailViewFilter = FocusedMailViewStore.mailView()
return false unless focusedMailViewFilter?.canRemoveThreads()
classNames = "btn action action-#{RemoveThreadHelper.removeType()}"
<div className="inner">
<div key="remove" className={classNames} onClick={@_onRemove}></div>
</div>
shouldComponentUpdate: (newProps, newState) ->
newProps.thread.id isnt @props?.thread.id
_onRemove: (event) =>
focusedMailViewFilter = FocusedMailViewStore.mailView()
t = RemoveThreadHelper.getRemovalTask([@props.thread], focusedMailViewFilter)
Actions.queueTask(t)
# Don't trigger the thread row click
event.stopPropagation()
module.exports = ThreadListQuickActions