Mailspring/internal_packages/draft-list/lib/sending-cancel-button.cjsx
Juan Tejada 687597134d feat(selection): Add new display for selection count + update toolbar
Summary:
- New behavior is that the in split mode, you will perform actions on
  the selection via the MessageListToolbar (the toolbar positioned above
  the message list)
- Refactored and moved around a bunch of code to achieve this:
  - Mostly renaming stuff and moving stuff around and removing some
    duplication
  - Update naming of toolbar role to a single role, and update relevant code
  - Converted and refactored a bunch of code into ES6, specifically to reuse the code for the ThreadActionsToolbar at the 2 locations
  - Deprecated MultiselectActionBar in favor of MultiselectToolbar
  - Deprecated old roles
- Punted the animation for the stackable cards in the selection display for now.
- #370

Test Plan: - Manual and unit tests

Reviewers: evan, drew, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2756
2016-03-21 12:20:11 -07:00

32 lines
829 B
CoffeeScript

React = require 'react'
{Actions} = require 'nylas-exports'
{RetinaImg} = require 'nylas-component-kit'
class SendingCancelButton extends React.Component
@displayName: 'SendingCancelButton'
@propTypes:
taskId: React.PropTypes.string.isRequired
constructor: (@props) ->
@state =
cancelling: false
render: =>
if @state.cancelling
<RetinaImg
style={width: 20, height: 20, marginTop: 2}
name="inline-loading-spinner.gif"
mode={RetinaImg.Mode.ContentPreserve} />
else
<div onClick={@_onClick} style={marginTop: 1}>
<RetinaImg
name="image-cancel-button.png"
mode={RetinaImg.Mode.ContentPreserve} />
</div>
_onClick: =>
Actions.dequeueTask(@props.taskId)
@setState(cancelling: true)
module.exports = SendingCancelButton