mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
fc770a85cd
Summary: still WIP, but functionality is there. TODO: [x] write tests [x] swap out the current markasread icon for the correct markasread icon that @sdw is making [x] figure out how to address this point by @bengotow: https://phab.nylas.com/D2024?id=19139#inline-12168 Test Plan: tested manually. still need to write tests though. Reviewers: evan, bengotow Reviewed By: bengotow Subscribers: sdw Maniphest Tasks: T3483 Differential Revision: https://phab.nylas.com/D2024
29 lines
858 B
CoffeeScript
29 lines
858 B
CoffeeScript
React = require 'react'
|
|
{Actions, FocusedContentStore, ChangeUnreadTask} = 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: -106}
|
|
data-tooltip="Mark as #{fragment}"
|
|
onClick={@_onClick}>
|
|
<RetinaImg name="icon-toolbar-markas#{fragment}@2x.png"
|
|
mode={RetinaImg.Mode.ContentIsMask} />
|
|
</button>
|
|
|
|
_onClick: (e) =>
|
|
e.stopPropagation()
|
|
|
|
task = new ChangeUnreadTask
|
|
thread: @props.thread
|
|
unread: !@props.thread.unread
|
|
Actions.queueTask task
|
|
Actions.popSheet()
|
|
|
|
module.exports = ThreadToggleUnreadButton
|