Mailspring/packages/client-app/internal_packages/message-list/lib/thread-toggle-unread-button.cjsx
Juan Tejada 15bcf974d2 [client-app] For consistency, proxy marking unread thru ThreadListActionStore
Summary: Depends on D3990

Test Plan: manual

Reviewers: spang, halla, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3992
2017-02-21 12:31:07 -08:00

26 lines
812 B
CoffeeScript

{Actions, React, FocusedContentStore} = require 'nylas-exports'
{RetinaImg} = require 'nylas-component-kit'
class ThreadToggleUnreadButton extends React.Component
@displayName: "ThreadToggleUnreadButton"
@containerRequired: false
render: =>
fragment = if @props.thread?.unread then "read" else "unread"
<button className="btn btn-toolbar"
style={order: -105}
title="Mark as #{fragment}"
onClick={@_onClick}>
<RetinaImg name="toolbar-markas#{fragment}.png"
mode={RetinaImg.Mode.ContentIsMask} />
</button>
_onClick: (e) =>
Actions.toggleUnreadThreads({
source: "Toolbar Button: Thread List",
threads: [@props.thread],
})
Actions.popSheet()
e.stopPropagation()
module.exports = ThreadToggleUnreadButton