deduplicate days

This commit is contained in:
2024-09-02 10:24:42 -06:00
parent 13be104499
commit 1b03061fdd
7 changed files with 60 additions and 18 deletions

View File

@@ -20,15 +20,15 @@ export const CalendarMonth = ({ month }: { month: CalendarMonthModel }) => {
return (
<>
<h3 className="text-center text-2xl">
<button
{/* <button
type="button"
className="btn btn-link"
onClick={toggleCollapse}
aria-expanded={!isCollapsed}
aria-controls={monthName}
>
> */}
{monthName}
</button>
{/* </button> */}
</h3>
<div id={monthName}>

View File

@@ -10,20 +10,21 @@ export default function Day({ day, month }: { day: Date; month: number }) {
const backgroundClass = isInSameMonth ? "" : "bg-slate-900";
return (
<>
<div
className={
"border border-slate-600 rounded-lg p-2 pb-4 m-1 " + backgroundClass
}
>
{day.getDate()}
{moduleNames.map((moduleName) => (
<div
key={"" + day + month + moduleName}
className={
"border border-slate-600 rounded-lg p-2 pb-4 m-1 " + backgroundClass
}
onDrop={() => itemDrop(day)}
onDragOver={(e) => e.preventDefault()}
>
{day.getDate()}
<DayItemsInModule day={day} moduleName={moduleName} />
</div>
))}
</>
</div>
);
}

View File

@@ -14,7 +14,7 @@ export default async function CourseLayout({
await hydrateCourse(queryClient, courseName);
const dehydratedState = dehydrate(queryClient);
console.log("hydrated course state", courseName, dehydratedState);
// console.log("hydrated course state", courseName, dehydratedState);
return (
<HydrationBoundary state={dehydratedState}>{children}</HydrationBoundary>
);