mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-06 08:08:10 +08:00
23 lines
751 B
JavaScript
23 lines
751 B
JavaScript
const { React, PropTypes, Utils } = require('mailspring-exports');
|
|
|
|
class SendingProgressBar extends React.Component {
|
|
static propTypes = { progress: PropTypes.number.isRequired };
|
|
|
|
render() {
|
|
const otherProps = Utils.fastOmit(this.props, Object.keys(this.constructor.propTypes));
|
|
if (0 < this.props.progress && this.props.progress < 99) {
|
|
return (
|
|
<div className="sending-progress" {...otherProps}>
|
|
<div className="filled" style={{ width: `${Math.min(100, this.props.progress)}%` }} />
|
|
</div>
|
|
);
|
|
} else {
|
|
return (
|
|
<div className="sending-progress" {...otherProps}>
|
|
<div className="indeterminate" />
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
}
|
|
module.exports = SendingProgressBar;
|