indicators for month collapsing

This commit is contained in:
2025-01-22 13:16:12 -07:00
parent f96dcb070f
commit 3340dcd264

View File

@@ -5,6 +5,8 @@ import { Expandable } from "@/components/Expandable";
import { CalendarWeek } from "./CalendarWeek"; import { CalendarWeek } from "./CalendarWeek";
import { useLocalCourseSettingsQuery } from "@/hooks/localCourse/localCoursesHooks"; import { useLocalCourseSettingsQuery } from "@/hooks/localCourse/localCoursesHooks";
import { getDateFromStringOrThrow } from "@/models/local/utils/timeUtils"; import { getDateFromStringOrThrow } from "@/models/local/utils/timeUtils";
import UpChevron from "@/components/icons/UpChevron";
import DownChevron from "@/components/icons/DownChevron";
export const CalendarMonth = ({ month }: { month: CalendarMonthModel }) => { export const CalendarMonth = ({ month }: { month: CalendarMonthModel }) => {
// const weekInMilliseconds = 604_800_000; // const weekInMilliseconds = 604_800_000;
@@ -36,17 +38,19 @@ export const CalendarMonth = ({ month }: { month: CalendarMonthModel }) => {
<> <>
<Expandable <Expandable
defaultExpanded={!isInPast} defaultExpanded={!isInPast}
ExpandableElement={({ setIsExpanded }) => ( ExpandableElement={({ setIsExpanded, isExpanded }) => (
<div className="flex justify-center"> <div className="flex justify-center">
<h3 <h3
className={ className={
"text-2xl transition-all duration-500 " + "text-2xl transition-all duration-500 " +
"hover:text-slate-50 underline hover:scale-105 " "hover:text-slate-50 underline hover:scale-105 " +
"flex "
} }
onClick={() => setIsExpanded((e) => !e)} onClick={() => setIsExpanded((e) => !e)}
role="button" role="button"
> >
{monthName} {monthName}
<div className="my-auto">{isExpanded ? <UpChevron /> : <DownChevron />}</div>
</h3> </h3>
</div> </div>
)} )}