variable progress bar color

This commit is contained in:
Ruidy Nemausat 2020-03-03 19:13:56 +01:00
parent 10523c588c
commit 0b4b605280

View file

@ -16,7 +16,18 @@ export const ProgressBar: FC<ProgressBarProps> = ({
remainingDays
}) => {
const styleString: CSSProperties = { width: `${value}%` };
const barColor: string = value < 75 ? "red" : "";
let barColor: string = "green";
if (value < 100) {
barColor = "yellow";
}
if (value < 200 / 3) {
barColor = "orange";
}
if (value < 100 / 3) {
barColor = "red";
}
return (
<>
<div className="row">