element-web/src/views/molecules/ProgressBar.js

19 lines
593 B
JavaScript
Raw Normal View History

2015-06-11 20:23:02 +03:00
var React = require('react');
var ProgressBarController = require("./../molecules/ProgressBar");
2015-06-11 20:23:02 +03:00
module.exports = React.createClass({
mixins: [ProgressBarController],
2015-06-11 20:23:02 +03:00
render: function() {
// Would use an HTML5 progress tag but if that doesn't animate if you
// use the HTML attributes rather than styles
var progressStyle = {
width: ((this.props.value / this.props.max) * 100)+"%"
};
return (
<div className="mx_ProgressBar"><div className="mx_ProgressBar_fill" style={progressStyle}></div></div>
);
}
});