@@ -26,10 +26,11 @@ import TaskCardCalendar from "./TaskCardCalendar"
2626const CalendarDayCell = ( {
2727 day,
2828 tasks,
29- isCurrentMonth,
3029 onSelectTask,
3130 onDayClick,
32- onShowMoreClick
31+ onShowMoreClick,
32+ isCurrentMonth,
33+ isSelected
3334} ) => {
3435 const [ isHovered , setIsHovered ] = useState ( false )
3536 const firstTask = tasks [ 0 ]
@@ -39,20 +40,24 @@ const CalendarDayCell = ({
3940 < div
4041 onMouseEnter = { ( ) => setIsHovered ( true ) }
4142 onMouseLeave = { ( ) => setIsHovered ( false ) }
43+ onClick = { ( ) => onDayClick ( day ) }
4244 className = { cn (
43- "border-r border-b border-neutral-800 p-2 flex flex-col gap-1 overflow-hidden relative min-h-[120px]" ,
44- ! isCurrentMonth && "bg-neutral-900/50" ,
45- "hover:bg-neutral-800/70"
45+ "border-r border-b border-neutral-800 p-2 flex flex-col gap-1 overflow-hidden relative min-h-[120px] rounded-lg" ,
46+ ! isCurrentMonth && "bg-brand-black text-neutral-600" ,
47+ "hover:bg-neutral-800/70" ,
48+ isSelected && "bg-brand-orange text-brand-black font-bold"
4649 ) }
4750 >
4851 < div className = "flex justify-between items-center" >
4952 < span
5053 className = { cn (
51- "font-semibold text-sm" ,
52- isToday ( day )
53- ? "text-sentient-blue"
54- : "text-neutral-300" ,
55- ! isCurrentMonth && "text-neutral-600"
54+ "font-sans font-semibold text-sm w-6 h-6 flex items-center justify-center rounded-full" ,
55+ isToday ( day ) ? "border border-brand-orange" : "" ,
56+ isSelected
57+ ? "text-brand-black"
58+ : isCurrentMonth
59+ ? "text-neutral-300"
60+ : "text-neutral-600"
5661 ) }
5762 >
5863 { format ( day , "d" ) }
@@ -84,6 +89,9 @@ const CalendarDayCell = ({
8489 onSelectTask = { onSelectTask }
8590 />
8691 ) }
92+ { tasks . length > 0 && (
93+ < div className = "w-1 h-1 bg-brand-yellow rounded-full mx-auto mt-1" > </ div >
94+ ) }
8795 { hasMoreTasks && (
8896 < div className = "w-full text-center text-xs text-neutral-400 p-1 rounded-md hover:bg-neutral-700/50" >
8997 < IconDots size = { 16 } className = "mx-auto" />
@@ -96,6 +104,7 @@ const CalendarDayCell = ({
96104
97105const CalendarView = ( { tasks, onSelectTask, onDayClick, onShowMoreClick } ) => {
98106 const [ currentMonth , setCurrentMonth ] = useState ( new Date ( ) )
107+ const [ selectedDate , setSelectedDate ] = useState ( new Date ( ) )
99108
100109 const monthStart = startOfMonth ( currentMonth )
101110 const monthEnd = endOfMonth ( currentMonth )
@@ -107,28 +116,33 @@ const CalendarView = ({ tasks, onSelectTask, onDayClick, onShowMoreClick }) => {
107116 const nextMonth = ( ) => setCurrentMonth ( addMonths ( currentMonth , 1 ) )
108117 const prevMonth = ( ) => setCurrentMonth ( subMonths ( currentMonth , 1 ) )
109118
119+ const handleDayClickInternal = ( day ) => {
120+ setSelectedDate ( day )
121+ onDayClick ( day )
122+ }
123+
110124 return (
111- < div className = "p-6 h-full flex flex-col" >
125+ < div className = "p-4 h-full flex flex-col bg-brand-gray rounded-xl border border-zinc-700 " >
112126 < header className = "flex items-center justify-between mb-4" >
113- < h2 className = "text-xl font-semibold text-white" >
127+ < h2 className = "text-lg font-sans font-semibold text-white" >
114128 { format ( currentMonth , "MMMM yyyy" ) }
115129 </ h2 >
116130 < div className = "flex items-center gap-2" >
117131 < button
118132 onClick = { prevMonth }
119- className = "p-2 rounded-full hover:bg-neutral-800"
133+ className = "p-2 rounded-full hover:bg-neutral-800 text-brand-orange "
120134 >
121135 < IconChevronLeft size = { 20 } />
122136 </ button >
123137 < button
124138 onClick = { nextMonth }
125- className = "p-2 rounded-full hover:bg-neutral-800"
139+ className = "p-2 rounded-full hover:bg-neutral-800 text-brand-orange "
126140 >
127141 < IconChevronRight size = { 20 } />
128142 </ button >
129143 </ div >
130144 </ header >
131- < div className = "grid grid-cols-7 text-center text-sm text-neutral -400 border-b border-neutral-800 pb-2" >
145+ < div className = "grid grid-cols-7 text-center text-xs text-zinc -400 font-sans border-b border-neutral-800 pb-2" >
132146 { [ "Sun" , "Mon" , "Tue" , "Wed" , "Thu" , "Fri" , "Sat" ] . map (
133147 ( day ) => (
134148 < div key = { day } > { day } </ div >
@@ -147,8 +161,9 @@ const CalendarView = ({ tasks, onSelectTask, onDayClick, onShowMoreClick }) => {
147161 tasks = { tasksForDay }
148162 isCurrentMonth = { isSameMonth ( day , currentMonth ) }
149163 onSelectTask = { onSelectTask }
150- onDayClick = { onDayClick }
164+ onDayClick = { handleDayClickInternal }
151165 onShowMoreClick = { onShowMoreClick }
166+ isSelected = { isSameDay ( day , selectedDate ) }
152167 />
153168 )
154169 } ) }
0 commit comments