Mailspring/internal_packages/message-list/lib/thread-toggle-unread-button.cjsx
dillon 793acfa132 fix(toolbar): swap mark-as-unread and archive buttons
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
2015-09-16 17:48:56 -07:00

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