From 4ae2fd1ebf9d342ad53660c37b3dd507c8d1ff92 Mon Sep 17 00:00:00 2001 From: Alexander Trost Date: Tue, 27 Aug 2024 17:48:10 +0200 Subject: [PATCH] fix: dispatch time to text color logic Signed-off-by: Alexander Trost --- app/components/centrum/helpers.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/components/centrum/helpers.ts b/app/components/centrum/helpers.ts index bd9480324..2712affe2 100644 --- a/app/components/centrum/helpers.ts +++ b/app/components/centrum/helpers.ts @@ -137,18 +137,18 @@ export function dispatchTimeToTextColor( const time = (Date.now() - toDate(date).getTime()) / 1000; const over = time / maxTime; - if (over >= 0.1) { - return 'text-yellow-100'; - } else if (over >= 0.2) { - return 'text-yellow-300'; - } else if (over >= 0.35) { - return 'text-orange-300'; - } else if (over >= 0.55) { - return 'text-orange-400'; + if (over >= 0.85) { + return 'text-red-700 animate-bounce'; } else if (over >= 0.7) { return 'text-red-400'; - } else if (over > 0.85) { - return 'text-red-700 animate-bounce'; + } else if (over >= 0.55) { + return 'text-orange-400'; + } else if (over >= 0.35) { + return 'text-orange-300'; + } else if (over >= 0.2) { + return 'text-yellow-300'; + } else if (over >= 0.1) { + return 'text-yellow-100'; } return '';