Skip to content

Commit

Permalink
Fix #3433: Progressbar dynamic progress bar (#3438)
Browse files Browse the repository at this point in the history
* Add Dynamic Progressbar Component

* Fix : npm run format in progressbar
  • Loading branch information
habubey authored Oct 7, 2022
1 parent 5489908 commit cfa58db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions components/lib/progressbar/ProgressBar.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
position: absolute;
display: none;
border: 0 none;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}

.p-progressbar-determinate .p-progressbar-value-animate {
Expand Down
10 changes: 8 additions & 2 deletions components/lib/progressbar/ProgressBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ export const ProgressBar = React.memo(

return (
<div role="progressbar" id={props.id} ref={elementRef} className={className} style={props.style} aria-valuemin="0" aria-valuenow={props.value} aria-valuemax="100" {...otherProps}>
<div className="p-progressbar-value p-progressbar-value-animate" style={{ width: props.value + '%', display: 'block', backgroundColor: props.color }}></div>
{label}
<div className="p-progressbar-value p-progressbar-value-animate" style={{ width: props.value + '%', display: 'block', backgroundColor: props.color }}>
{props.showValue && (
<div className={`p-progressbar-label`} style={{ display: props.value != null && props.value !== 0 ? 'flex' : 'none' }}>
{' '}
{label}
</div>
)}
</div>
</div>
);
};
Expand Down

0 comments on commit cfa58db

Please sign in to comment.