mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 21:57:55 +08:00
33 lines
829 B
Text
33 lines
829 B
Text
|
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
|