mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 21:57:55 +08:00
4e6b4f4c9c
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
30 lines
844 B
CoffeeScript
30 lines
844 B
CoffeeScript
_ = require 'underscore'
|
|
React = require 'react'
|
|
{Actions, Utils, ChangeStarredTask} = require 'nylas-exports'
|
|
{RetinaImg} = require 'nylas-component-kit'
|
|
|
|
class StarButton extends React.Component
|
|
@displayName: "StarButton"
|
|
@containerRequired: false
|
|
@propTypes:
|
|
thread: React.PropTypes.object
|
|
|
|
render: =>
|
|
selected = @props.thread? and @props.thread.starred
|
|
<button className="btn btn-toolbar"
|
|
style={order: -104}
|
|
data-tooltip="Star"
|
|
onClick={@_onStarToggle}>
|
|
<RetinaImg name="toolbar-star.png" mode={RetinaImg.Mode.ContentIsMask} selected={selected} />
|
|
</button>
|
|
|
|
_onStarToggle: (e) =>
|
|
task = new ChangeStarredTask({
|
|
thread: @props.thread
|
|
starred: !@props.thread.starred
|
|
})
|
|
Actions.queueTask(task)
|
|
e.stopPropagation()
|
|
|
|
|
|
module.exports = StarButton
|