mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
15bcf974d2
Summary: Depends on D3990 Test Plan: manual Reviewers: spang, halla, evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D3992
26 lines
812 B
CoffeeScript
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
|