-
+
+
+
+
+
+
+
+
diff --git a/nextjs/src/app/todaysLectures/OneCourseLectures.tsx b/nextjs/src/app/todaysLectures/OneCourseLectures.tsx
new file mode 100644
index 0000000..2e8ca6e
--- /dev/null
+++ b/nextjs/src/app/todaysLectures/OneCourseLectures.tsx
@@ -0,0 +1,34 @@
+"use client";
+
+import { useLecturesByWeekQuery } from "@/hooks/localCourse/lectureHooks";
+import { getDateOnlyMarkdownString } from "@/models/local/timeUtils";
+import { getLecturePreviewUrl } from "@/services/urlUtils";
+import Link from "next/link";
+import { useCourseContext } from "../course/[courseName]/context/courseContext";
+
+export default function OneCourseLectures() {
+ const { courseName } = useCourseContext();
+ const { data: weeks } = useLecturesByWeekQuery();
+
+ const dayAsDate = new Date();
+ const dayAsString = getDateOnlyMarkdownString(dayAsDate);
+ const todaysLecture = weeks
+ .flatMap((w) => w.lectures)
+ .find((l) => l.date == dayAsString);
+ if (!todaysLecture) return <>>;
+ return (
+
+ {todaysLecture?.name}
+
+ {courseName} + + ); +} diff --git a/nextjs/src/app/todaysLectures/TodaysLectures.tsx b/nextjs/src/app/todaysLectures/TodaysLectures.tsx new file mode 100644 index 0000000..e96bacd --- /dev/null +++ b/nextjs/src/app/todaysLectures/TodaysLectures.tsx @@ -0,0 +1,26 @@ +"use client"; + +import { useLocalCoursesSettingsQuery } from "@/hooks/localCourse/localCoursesHooks"; +import OneCourseLectures from "./OneCourseLectures"; +import { SuspenseAndErrorHandling } from "@/components/SuspenseAndErrorHandling"; +import CourseContextProvider from "../course/[courseName]/context/CourseContextProvider"; + +export default function TodaysLectures() { + const { data: allSettings } = useLocalCoursesSettingsQuery(); + return ( +
+
+
+
+
+
+
+ +
+
+ {courseName} + + ); +} diff --git a/nextjs/src/app/todaysLectures/TodaysLectures.tsx b/nextjs/src/app/todaysLectures/TodaysLectures.tsx new file mode 100644 index 0000000..e96bacd --- /dev/null +++ b/nextjs/src/app/todaysLectures/TodaysLectures.tsx @@ -0,0 +1,26 @@ +"use client"; + +import { useLocalCoursesSettingsQuery } from "@/hooks/localCourse/localCoursesHooks"; +import OneCourseLectures from "./OneCourseLectures"; +import { SuspenseAndErrorHandling } from "@/components/SuspenseAndErrorHandling"; +import CourseContextProvider from "../course/[courseName]/context/CourseContextProvider"; + +export default function TodaysLectures() { + const { data: allSettings } = useLocalCoursesSettingsQuery(); + return ( +
+ {/*
+ );
+}
todays lectures
*/} +
+
+ {allSettings.map((settings) => (
+
+
+
+
+
+
+
+ ))}
+