mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
267a719016
Summary: fixes T3628 problem - mark-as-read button was in most prominent location - archive button is most used button, but unfortunately in less prominent location - user is annoyed at inconvenient real estate allocation Test Plan: tested manually for regressions. all previous tests still green. Reviewers: bengotow Maniphest Tasks: T3628 Differential Revision: https://phab.nylas.com/D2033
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: -105}
|
|
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
|