diff --git a/frontend/src/pages/lectures/Lectures.tsx b/frontend/src/pages/lectures/Lectures.tsx
index 0a28941..3f711bc 100644
--- a/frontend/src/pages/lectures/Lectures.tsx
+++ b/frontend/src/pages/lectures/Lectures.tsx
@@ -329,14 +329,6 @@ function LectureCard({ event }: { event: DiscordEvent }) {
{event.description && (
{event.description}
)}
-
- View on Discord (Add to Calendar)
-
);
}
@@ -345,14 +337,16 @@ export default function Lectures() {
const [events, setEvents] = useState([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
- const [calendarCopyError, setCalendarCopyError] = useState(false);
+ const [calendarCopyStatus, setCalendarCopyStatus] = useState<
+ "idle" | "copied" | "error"
+ >("idle");
- const openGoogleCalendarSubscription = async () => {
+ const handleCopyCalendarUrl = async () => {
try {
await copyCalendarFeedUrl();
- window.location.assign(GOOGLE_CALENDAR_ADD_BY_URL);
+ setCalendarCopyStatus("copied");
} catch {
- setCalendarCopyError(true);
+ setCalendarCopyStatus("error");
}
};
@@ -390,19 +384,14 @@ export default function Lectures() {
featuring experts in GPU programming.
- {/* In Person Events Section */}
-
- In Person Events
- {activeInPerson.length === 0 ? (
-
- No in-person events currently scheduled. Check back soon!
-
- ) : (
- activeInPerson.map((event) => (
+ {activeInPerson.length > 0 && (
+
+ In Person Events
+ {activeInPerson.map((event) => (
- ))
- )}
-
+ ))}
+
+ )}
{/* Kernel Competitions Section */}
@@ -440,26 +429,82 @@ export default function Lectures() {
.
-
-
- {calendarCopyError
- ? `Copy ${LECTURE_CALENDAR_FEED_URL}, then open Google Calendar → Other calendars → From URL.`
- : "Paste the copied URL into “URL of calendar,” then click Add calendar. You only need to do this once."}
-
+
+ 1. Copy this calendar URL:
+
+
+
+ {LECTURE_CALENDAR_FEED_URL}
+
+
+
+ {calendarCopyStatus === "error" && (
+
+ Could not copy automatically. Select and copy the URL above.
+
+ )}
+
+ 2. Open Google Calendar and paste it into “URL of calendar.”
+
+
+
+ Click Add calendar. You only need to do this once.
+
+
{loading ? (
) : error ? (