From d016de90e6a6006bd229e67a80c5c7e9e743c7f8 Mon Sep 17 00:00:00 2001 From: ksantoso2 <130810746+ksantoso2@users.noreply.github.com> Date: Thu, 6 Nov 2025 15:29:23 -0800 Subject: [PATCH 1/2] clean up forum dash --- frontend/src/components/ui/ForumDashboard.tsx | 221 +++++++++--------- 1 file changed, 117 insertions(+), 104 deletions(-) diff --git a/frontend/src/components/ui/ForumDashboard.tsx b/frontend/src/components/ui/ForumDashboard.tsx index dd73b90..0b13be9 100644 --- a/frontend/src/components/ui/ForumDashboard.tsx +++ b/frontend/src/components/ui/ForumDashboard.tsx @@ -80,7 +80,7 @@ const ForumDashboard = () => { if (!selectedEvent) return; try { - setIsEngageLoading(true); + setIsLoading(true); const response = await fetch( `${process.env.BACKEND_LINK}/api/openforum/${selectedEvent}`, @@ -103,21 +103,17 @@ const ForumDashboard = () => { } catch (error) { console.error('Error fetching event data:', error); } finally { - setIsEngageLoading(false); + setIsLoading(false); } }; fetchEventData(); }, [selectedEvent]); - // Fetch selected event data + // Fetch Engage data useEffect(() => { const fetchEngageEvents = async () => { - if (!isEngagePopupOpen) return; - try { - setIsLoading(true); - const response = await fetch( `${process.env.BACKEND_LINK}/api/events` ); @@ -130,11 +126,13 @@ const ForumDashboard = () => { } catch (error) { console.error('Error fetching Engage events:', error); } finally { - setIsLoading(false); + setIsEngageLoading(false); } }; - fetchEngageEvents(); + if (isEngagePopupOpen) { + fetchEngageEvents(); + } }, [isEngagePopupOpen]); const resetForm = () => { @@ -361,7 +359,7 @@ const ForumDashboard = () => { - {/* Popup body */} - {isEngageLoading ? ( -

- Loading events from Engage... -

- ) : engageEvents.length > 0 ? ( - - ) : ( -

- No Engage events found. -

- )} - -
+

+ {event.name} +

+ +

+ Date:{' '} + {new Date( + event.start + ).toLocaleString()}{' '} + →{' '} + {new Date( + event.end + ).toLocaleString()} +

+ +

+ + Location: + {' '} + {event.location || + 'N/A'} +

+ +

+ Host:{' '} + {event.host || + 'Unknown'} +

+ +
+ +
+ +
+ + View on Engage ↗ + + + +
+ + ) + )} + + ) : ( +
+

+ No Engage events found. +

+
+ )} +
+ + {/* Footer */} +
)} - {engageEventId && (
From f7206baa2a14d17ce0eec7d1979c38c2f7239e87 Mon Sep 17 00:00:00 2001 From: ksantoso2 <130810746+ksantoso2@users.noreply.github.com> Date: Thu, 6 Nov 2025 15:34:57 -0800 Subject: [PATCH 2/2] cleanup --- frontend/src/components/ui/ForumDashboard.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/frontend/src/components/ui/ForumDashboard.tsx b/frontend/src/components/ui/ForumDashboard.tsx index 0b13be9..fb41421 100644 --- a/frontend/src/components/ui/ForumDashboard.tsx +++ b/frontend/src/components/ui/ForumDashboard.tsx @@ -632,13 +632,6 @@ const ForumDashboard = () => {

Custom Questions

- {/*