From 0b4b6052801e47b719c363cf6e8951b787b2a65b Mon Sep 17 00:00:00 2001 From: Ruidy Nemausat Date: Tue, 3 Mar 2020 19:13:56 +0100 Subject: [PATCH] variable progress bar color --- client/src/components/ProgressBar.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/client/src/components/ProgressBar.tsx b/client/src/components/ProgressBar.tsx index e6444f5..bf0ff90 100644 --- a/client/src/components/ProgressBar.tsx +++ b/client/src/components/ProgressBar.tsx @@ -16,7 +16,18 @@ export const ProgressBar: FC = ({ 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 ( <>