diff --git a/client/src/components/CourseView/LiveClassCard.jsx b/client/src/components/CourseView/LiveClassCard.jsx index a91e786..44e4520 100644 --- a/client/src/components/CourseView/LiveClassCard.jsx +++ b/client/src/components/CourseView/LiveClassCard.jsx @@ -12,88 +12,95 @@ function LiveClassCard({ const statusMeta = isLive ? { - label: "LIVE NOW", - dot: "bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.6)]", + label: "Live", + color: "text-red-500", bg: "bg-red-500/10", - text: "text-red-400", - border: "border-red-500/25", - bar: "from-red-500 to-red-600", - icon: "πŸ“‘", - cardBorder: - "border-red-500/25 shadow-[0_0_32px_-8px_rgba(239,68,68,0.15)]", + border: "border-red-500/20", + dot: "bg-red-500", } : isEnded ? { label: "Ended", - dot: "bg-[var(--muted)]/40", - bg: "bg-[var(--border)]/8", - text: "text-[var(--muted)]", - border: "border-[var(--border)]/18", - bar: "from-gray-500 to-gray-600", - icon: "πŸ“Ό", - cardBorder: "border-[var(--border)]/15", + color: "text-gray-400", + bg: "bg-gray-500/10", + border: "border-gray-500/20", + dot: "bg-gray-400", } : { label: "Scheduled", - dot: "bg-blue-400", + color: "text-blue-500", bg: "bg-blue-500/10", - text: "text-blue-400", border: "border-blue-500/20", - bar: "from-blue-500 to-indigo-600", - icon: "πŸ“…", - cardBorder: - "border-[var(--border)]/12 hover:border-[var(--accent)]/18", + dot: "bg-blue-500", }; return (
+ {/* Top Accent Bar */} +
+ +
+======= className={`group bg-[var(--surface)] rounded-2xl border overflow-hidden transition-all duration-300 hover:shadow-[0_8px_24px_-8px_rgba(0,0,0,0.10)] ${statusMeta.cardBorder}`} >
+>>>>>>> 42795c9a6a2ed72e942e6619110abc54bb76c281 {/* Icon */}
- {statusMeta.icon} + {isLive ? "πŸ“‘" : isEnded ? "πŸ“Ό" : "πŸ“…"}
+ {/* Content */}
- {/* Title + status */} -
-

+ {/* Title + badges */} +
+

{liveClass.title} -

+

+ {statusMeta.label} - {/* Type badge */} - - {isPlatform ? "πŸ–₯️ On Platform" : "πŸ”— External Link"} + + + {isPlatform ? "Platform" : "External"}
{/* Description */} {liveClass.description && ( -

+

{liveClass.description}

)} - {/* Meta pills */} -
- + {/* Meta */} +
+ πŸ“…{" "} {new Date(liveClass.scheduledAt).toLocaleDateString("en-US", { month: "short", @@ -105,115 +112,95 @@ function LiveClassCard({ minute: "2-digit", })} + {liveClass.attendeeCount > 0 && ( - - πŸ‘₯ {liveClass.attendeeCount} attended + + πŸ‘₯ {liveClass.attendeeCount} )}
- {/* External meeting link (meetLink type only) */} -
+ {/* Links */} +
{!isPlatform && liveClass.meetingLink && !isEnded && ( πŸ”— Meeting Link - - - )} + {liveClass.recordingUrl && ( - β–Ά Watch Recording + β–Ά Recording )}
{/* Actions */} -
+
{isTeacher ? ( <> {isScheduled && ( )} - {/* Enter classroom (platform) or end class */} + {isLive && isPlatform && ( )} + {isLive && ( )} + ) : ( isLive && ( - <> - {isPlatform ? ( - /* Platform class β†’ navigate to the live room */ - - ) : ( - /* External meeting link β†’ open in new tab */ - - )} - + ) )}
diff --git a/client/src/components/CourseView/LiveClassesTab.jsx b/client/src/components/CourseView/LiveClassesTab.jsx index 50079dd..2b5d77d 100644 --- a/client/src/components/CourseView/LiveClassesTab.jsx +++ b/client/src/components/CourseView/LiveClassesTab.jsx @@ -2,12 +2,16 @@ import LiveClassCard from "./LiveClassCard"; function SectionLabel({ dot, label, count }) { return ( -
- -

- {label} - ({count}) -

+
+
+ +

+ {label} +

+
+ + {count} +
); } @@ -25,33 +29,36 @@ function LiveClassesTab({ const ended = liveClasses.filter((lc) => lc.status === "ended"); return ( -
- {/* Section header */} -
+
+ {/* Header */} +
-
+
πŸ“Ή
-

+

Live Classes

-

+

{liveClasses.length}{" "} - {liveClasses.length === 1 ? "session" : "sessions"} total + {liveClasses.length === 1 ? "session" : "sessions"} {liveNow.length > 0 && ( - - Β· {liveNow.length} live now + + β€’ {liveNow.length} live )}

+ {isTeacher && (
+ {/* Empty State */} {liveClasses.length === 0 ? ( +<<<<<<< HEAD +
+
+=======
+>>>>>>> 42795c9a6a2ed72e942e6619110abc54bb76c281 πŸ“Ή
-

+

No live classes yet

-

+

{isTeacher - ? "Schedule your first live session." - : "No live classes have been scheduled yet."} + ? "Start by scheduling your first session." + : "No sessions available at the moment."}

+ {isTeacher && ( )}
) : ( -
+
+ {/* Live */} {liveNow.length > 0 && (
-
+
{liveNow.map((lc, i) => (
)} + {/* Upcoming */} {upcoming.length > 0 && (
-
+
{upcoming.map((lc, i) => (
)} + {/* Past */} {ended.length > 0 && (
-
+
{ended.map((lc, i) => (
>>>>>> 42795c9a6a2ed72e942e6619110abc54bb76c281 }, }; @@ -54,7 +58,7 @@ const NAV_LINKS = [ { label: "Live Classes", icon: "πŸ“Ή", path: "/live-classes" }, ]; -function Navbar({ showBack }) { +function Navbar() { const navigate = useNavigate(); const location = useLocation(); const { themeName, setThemeName } = useContext(ThemeContext); @@ -110,13 +114,6 @@ function Navbar({ showBack }) { return () => document.removeEventListener("mousedown", handler); }, []); - const markAll = async () => { - await apiFetch(`/api/notifications/read-all/${user.id}`, { - method: "PATCH", - }); - setNotifs((prev) => prev.map((n) => ({ ...n, read: true }))); - }; - const cycleTheme = () => { setThemeName((prev) => (prev === "light" ? "dark" : "light")); }; @@ -129,16 +126,17 @@ function Navbar({ showBack }) { return (