Skip to content

Commit

Permalink
fix:coderabbitai
Browse files Browse the repository at this point in the history
  • Loading branch information
Innocent-Akim committed Dec 3, 2024
1 parent 8e61841 commit f39566a
Showing 1 changed file with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const generateFullCalendar = (currentMonth: Date) => {
return eachDayOfInterval({ start: startDate, end: endDate });
};




const MonthlyTimesheetCalendar: React.FC<MonthlyCalendarDataViewProps> = ({
data = [],
onDateClick,
Expand Down Expand Up @@ -78,20 +81,34 @@ const MonthlyTimesheetCalendar: React.FC<MonthlyCalendarDataViewProps> = ({
<div key={day}>{day}</div>
))}
</div>
<div className="grid grid-cols-7 mt-2 w-full">

<div
className="grid grid-cols-7 mt-2 w-full"
role="grid"
aria-label="Calendar"
>
{calendarDates.map((date) => {
const formattedDate = format(date, "yyyy-MM-dd");
const plan = groupedData.get(formattedDate);
return (
<div
key={formattedDate}
role="gridcell"
tabIndex={0}
aria-label={format(date, "MMMM d, yyyy")}
className={cn(
classNames.day,
"border flex flex-col gap-2 relative shadow-sm rounded min-h-[150px] sm:w-[250px] md:w-[300px] lg:w-[350px] max-w-full", {
"bg-gray-100 dark:bg-gray-900": date.getMonth() !== currentMonth.getMonth(),
}
)}
onClick={() => onDateClick?.(date)}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
onDateClick?.(date);
}
}}
>
<div className="px-2 flex items-center justify-between">
<span className="block text-gray-500 text-sm font-medium">
Expand All @@ -109,7 +126,13 @@ const MonthlyTimesheetCalendar: React.FC<MonthlyCalendarDataViewProps> = ({
{renderDayContent ? (
renderDayContent(date, plan)
) : plan ? (
<div>{JSON.stringify(plan)}</div>
<div className="p-2">
{plan.tasks.map((task) => (
<div key={task.id} className="text-sm mb-1 truncate">
{task.task?.title}
</div>
))}
</div>
) : (
<div className={classNames.noData || "text-gray-400 text-sm"}>
{noDataText}
Expand Down

0 comments on commit f39566a

Please sign in to comment.