Skip to content

Commit

Permalink
feat: fix entry colors
Browse files Browse the repository at this point in the history
  • Loading branch information
HereEast committed Oct 9, 2024
1 parent 1e14e2d commit af81a90
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client/src/components/Entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -38,7 +39,12 @@ export function Entry({ entry }: EntryProps) {
<div
className={cn(
"flex size-6 shrink-0 items-center justify-center rounded-[4px] bg-stone-300/50 text-sm",
currentRating > 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"
Expand Down

0 comments on commit af81a90

Please sign in to comment.