From 2ba62224789b8fd2df87377e41623d04b8d59ae1 Mon Sep 17 00:00:00 2001 From: Avent Chiu Date: Thu, 2 Nov 2023 12:05:25 -0700 Subject: [PATCH] Refactor code --- src/components/events/events.js | 114 ++++++++++++++------------------ src/pages/_app.js | 2 +- 2 files changed, 52 insertions(+), 64 deletions(-) diff --git a/src/components/events/events.js b/src/components/events/events.js index b7531a7..841ee92 100644 --- a/src/components/events/events.js +++ b/src/components/events/events.js @@ -49,10 +49,6 @@ export default function EventsSection() { Schedule - {/*
- Our full itinerary of Events and Workshops will be available soon! -
*/} - {sortedSchedule.map((date) => (
- {date - .sort((a, b) => { - const timeA = - parseInt(a.time, 10) + (a.time.includes("PM") ? 12 : 0); - const timeB = - parseInt(b.time, 10) + (b.time.includes("PM") ? 12 : 0); - return timeA - timeB; - }) - .map((event) => ( -
-
-
- Club Logo -
+ {date.map((event) => ( +
+
+
+ Club Logo +
-
-
-
- {event.title} -
-
- {`${event.time} • ${event.club && event.club + " • " } ${event.location}`} -
+
+
+
+ {event.title} +
+
+ {`${event.time} • ${event.club && event.club + " • " } ${event.location}`}
+
-
- {event.rsvp && ( - -
- RSVP - - - -
-
- )} +
+ {event.rsvp && ( + +
+ RSVP + + + +
+
+ )} - {event.recording && ( - -
- Recording - - - -
-
- )} -
+ {event.recording && ( + +
+ Recording + + + +
+
+ )}
-
- {event.desc} -
- ))} +
+ {event.desc} +
+
+ ))}
))}
diff --git a/src/pages/_app.js b/src/pages/_app.js index 4b18508..0f266e2 100644 --- a/src/pages/_app.js +++ b/src/pages/_app.js @@ -8,7 +8,7 @@ export default function MyApp({ Component, pageProps }) { return ( <> - +