mon-entreprise/source/components/ProgressCircle.js

29 lines
708 B
JavaScript
Raw Normal View History

2018-07-12 08:09:41 +00:00
import { Circle } from 'rc-progress/lib'
import React from 'react'
import { connect } from 'react-redux'
2018-07-12 08:09:41 +00:00
import { targetCompletionRatioSelector } from 'Selectors/progressCircleSelectors'
let ProgressCircle = ({ ratio, isActiveInput }) => (
<span
className="progressCircle"
style={{
visibility: isActiveInput ? 'hidden' : 'visible'
}}>
{ratio === 0 ? (
<i className="fa fa-check" aria-hidden="true" />
) : (
<Circle
2018-04-25 13:55:17 +00:00
percent={Math.max(2, 100 - ratio * 100)}
strokeWidth="15"
strokeColor="#5de662"
trailColor="#fff"
trailWidth="5"
/>
)}
</span>
)
export default connect((state, props) => ({
ratio: targetCompletionRatioSelector(state, props)
}))(ProgressCircle)