2016-02-05 06:14:24 +08:00
|
|
|
React = require 'react'
|
2016-03-25 04:55:26 +08:00
|
|
|
{Utils} = require 'nylas-exports'
|
2016-02-05 06:14:24 +08:00
|
|
|
|
|
|
|
class SendingProgressBar extends React.Component
|
|
|
|
@propTypes:
|
|
|
|
progress: React.PropTypes.number.isRequired
|
|
|
|
|
|
|
|
render: ->
|
2016-03-25 04:55:26 +08:00
|
|
|
otherProps = Utils.fastOmit(@props, Object.keys(@constructor.propTypes))
|
2016-02-05 06:14:24 +08:00
|
|
|
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
|