-
Notifications
You must be signed in to change notification settings - Fork 527
Expand file tree
/
Copy pathProgressBar.js
More file actions
33 lines (29 loc) · 959 Bytes
/
ProgressBar.js
File metadata and controls
33 lines (29 loc) · 959 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
import React from 'react'
import PropTypes from 'prop-types'
import './ProgressBar.css'
const ProgressBar = ({ bg, br, className, style, width, height, progress, time, ...props }) => {
return (
<div className={`ProgressBar sans-serif overflow-hidden ${br} dib ${className} ${width} ${height}`} style={{ background: 'var(--theme-bg-secondary)', ...style }} {...props}>
{time
? <div className={`${br} h-100 ${bg}`} style={{ animation: `progressBar ${time}s ease-in-out` }} />
: <div className={`${br} h-100 ${bg}`} style={{ width: `${progress}%` }} />}
</div>
)
}
ProgressBar.propTypes = {
className: PropTypes.string,
bg: PropTypes.string,
width: PropTypes.string,
height: PropTypes.string,
br: PropTypes.string,
time: PropTypes.number,
progress: PropTypes.number
}
ProgressBar.defaultProps = {
className: '',
width: 'w-100',
height: 'h1',
bg: 'bg-aqua',
br: 'br-pill'
}
export default ProgressBar