Mailspring/app/internal_packages/draft-list/lib/sending-progress-bar.cjsx

20 lines
630 B
CoffeeScript

{React, PropTypes, Utils} = require 'mailspring-exports'
class SendingProgressBar extends React.Component
@propTypes:
progress: PropTypes.number.isRequired
render: ->
otherProps = Utils.fastOmit(@props, Object.keys(@constructor.propTypes))
if 0 < @props.progress < 99
<div className="sending-progress" {...otherProps}>
<div className="filled"
style={width:"#{Math.min(100, @props.progress)}%"}>
</div>
</div>
else
<div className="sending-progress" {...otherProps}>
<div className="indeterminate"></div>
</div>
module.exports = SendingProgressBar