From af81a9034f6836e3c23e7a9b3ddd1e129eafa623 Mon Sep 17 00:00:00 2001 From: Nastia Piven Date: Wed, 9 Oct 2024 19:20:42 +0200 Subject: [PATCH] feat: fix entry colors --- client/src/components/Entry.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/components/Entry.tsx b/client/src/components/Entry.tsx index 8a9c3fa..25b65d4 100644 --- a/client/src/components/Entry.tsx +++ b/client/src/components/Entry.tsx @@ -26,6 +26,7 @@ export function Entry({ entry }: EntryProps) { const isValidEntry = entry.day <= today.day && entry.day >= 1; + // Handle click function handleClick() { if (isValidEntry) { const id = selectedEntryId === entry._id ? null : entry._id; @@ -38,7 +39,12 @@ export function Entry({ entry }: EntryProps) {
0 && statusColor(currentRating), + // currentRating > 0 && statusColor(currentRating), + (currentRating === 1 || currentRating === 2) && "bg-stone-400/50", + (currentRating === 3 || currentRating === 4) && "bg-stone-400", + (currentRating === 5 || currentRating === 6) && "bg-stone-500", + (currentRating === 7 || currentRating === 8) && "bg-stone-600", + (currentRating === 9 || currentRating === 10) && "bg-stone-800", isValidEntry && "hover:border hover:border-brown-600", selectedEntryId === entry._id ? "border border-brown-600"