Skip to content
This repository was archived by the owner on Mar 1, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/components/member-profile/active-task/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ const ActiveTask = ({ taskDetails }) => {
);
const showProgressIndicator = progressIndicator(showEstimatedDay, classNames);

const handleProgressBarColor = () => {
if (percentageOfDaysRemaining >= percentOfTaskLeft) {
return classNames.progressIndicatorGreen; // green
}
if (percentageOfDaysRemaining < 50 && percentOfTaskLeft > 75) {
return classNames.progressIndicatorOrange; // orange
}
if (percentageOfDaysRemaining < 25 && percentOfTaskLeft > 35) {
return classNames.progressIndicatorRed; // red
}
return classNames.progressIndicatorYellow; // yellow
};

const progressBarColor = handleProgressBarColor();

return (
<div className={classNames.container}>
<div className={classNames.taskSection}>
Expand All @@ -39,7 +54,7 @@ const ActiveTask = ({ taskDetails }) => {
</div>
<div className={classNames.progressBar}>
<div
className={showProgressIndicator}
className={`${showProgressIndicator} ${progressBarColor}`}
style={{ width: `${percentCompleted}%` }}
data-testid="progressIndicator"
/>
Expand Down