forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgressBar.js
More file actions
37 lines (32 loc) · 1010 Bytes
/
Copy pathProgressBar.js
File metadata and controls
37 lines (32 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react'
import I18n from 'i18n!react_files'
import classnames from 'classnames'
var ProgressBar = React.createClass({
render () {
var barClasses = classnames({
'progress-bar__bar': true,
'almost-done': this.props.progress === 100
});
var containerClasses = classnames({
'progress-bar__bar-container': true,
'almost-done': this.props.progress === 100
});
return (
<div ref='container' className={containerClasses}>
<div
ref='bar'
className={barClasses}
role='progressbar'
aria-valuenow={this.props.progress}
aria-valuemin="0"
aria-valuemax="100"
aria-label={this.props['aria-label'] || ''}
style={{
width: Math.min(this.props.progress, 100) + '%'
}}
/>
</div>
);
}
});
export default ProgressBar