Skip to content
Snippets Groups Projects
Verified Commit bbad2f03 authored by Dorian Koch's avatar Dorian Koch
Browse files

Add live label, closes #4

parent addb4c12
No related branches found
No related tags found
No related merge requests found
Pipeline #6371 passed
...@@ -16,8 +16,7 @@ import type { GetCourseResponse, lecture } from "@/api/api_v1_types"; ...@@ -16,8 +16,7 @@ import type { GetCourseResponse, lecture } from "@/api/api_v1_types";
import { ResourceType } from "@/misc/PromiseHelpers"; import { ResourceType } from "@/misc/PromiseHelpers";
import { AuthenticationMethodIcons } from "@/misc/Util"; import { AuthenticationMethodIcons } from "@/misc/Util";
import { useLanguage } from "./LanguageProvider"; import { useLanguage } from "./LanguageProvider";
import { DateTime } from "luxon"; import { LectureLiveLabel } from "./LiveLabel";
import LiveLabel, { LectureLiveLabel } from "./LiveLabel";
function ListingHeader({ course }: { course: GetCourseResponse }) { function ListingHeader({ course }: { course: GetCourseResponse }) {
const { editMode } = useEditMode(); const { editMode } = useEditMode();
......
...@@ -5,7 +5,7 @@ import type { lecture, course } from "@/api/api_v1_types"; ...@@ -5,7 +5,7 @@ import type { lecture, course } from "@/api/api_v1_types";
import { StylizedText } from "@/components/StylizedText"; import { StylizedText } from "@/components/StylizedText";
import { urlForLecture } from "@/misc/Util"; import { urlForLecture } from "@/misc/Util";
import { useLanguage } from "./LanguageProvider"; import { useLanguage } from "./LanguageProvider";
import LiveLabel, { LectureLiveLabel } from "./LiveLabel"; import { LectureLiveLabel } from "./LiveLabel";
export function VideoCard({ export function VideoCard({
lecture, lecture,
...@@ -78,7 +78,7 @@ export function VideoCard({ ...@@ -78,7 +78,7 @@ export function VideoCard({
</li> </li>
<li> <li>
<strong>{course.full_name}</strong> <strong>{course.full_name}</strong>
{typeof lecture.livestream_url === "string" && <LiveLabel nowlive={true} />} <LectureLiveLabel lecture={lecture} />
</li> </li>
<li>{dateStr}</li> <li>{dateStr}</li>
{lecture.speaker ? ( {lecture.speaker ? (
......
...@@ -20,7 +20,7 @@ import { useLanguage } from "@/components/LanguageProvider"; ...@@ -20,7 +20,7 @@ import { useLanguage } from "@/components/LanguageProvider";
import { useSearchParams } from "next/navigation"; import { useSearchParams } from "next/navigation";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { VideoCard } from "@/components/VideoCard"; import { VideoCard } from "@/components/VideoCard";
import LiveLabel, { LectureLiveLabel } from "@/components/LiveLabel"; import { LectureLiveLabel } from "@/components/LiveLabel";
function FeatureCard({ data, all_featured }: { data: featured; all_featured: featured[] }) { function FeatureCard({ data, all_featured }: { data: featured; all_featured: featured[] }) {
const { editMode } = useEditMode(); const { editMode } = useEditMode();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment