From 390759864c70fbe48789efc0093c756154dac989 Mon Sep 17 00:00:00 2001 From: dennisysj <145813845+dennisysj@users.noreply.github.com> Date: Fri, 13 Sep 2024 01:40:25 -0700 Subject: [PATCH] Removed references to old events api (#46) * what I changed in The AboutUsSection I changed the margin top to 96 from 32 In the home page section I commented out the useEffect() that was fetching calendar events as well as the imports for said events In the events section I commented out the loading conditions as well as the conditional statements and created a div to hold all the iframes that we currently have to put in manually for all the Luma events. added const iframeStyle so you can change the height width etc of all iframes in EventsSection Carousel event thunks and event tsx files were modified by commenting out anything relying on fetching events from the google calendar api --- frontend/src/app/Conditional.tsx | 8 +- frontend/src/app/EventsOnHomePage/Carosel.tsx | 62 +++++----- .../src/app/EventsOnHomePage/Decision.tsx | 10 +- .../app/EventsOnHomePage/EventeSection.tsx | 94 +++++++-------- frontend/src/app/Footer.tsx | 110 +++++++++--------- frontend/src/app/HomePage.tsx | 88 ++++++-------- frontend/src/app/NavBar.tsx | 29 +++-- frontend/src/app/aboutus.tsx | 20 ++-- frontend/src/app/events/EventsLuma.tsx | 98 ++++++++++++++++ frontend/src/app/events/EventsPage.tsx | 96 ++++++--------- frontend/src/components/ui/button.tsx | 2 +- 11 files changed, 327 insertions(+), 290 deletions(-) create mode 100644 frontend/src/app/events/EventsLuma.tsx diff --git a/frontend/src/app/Conditional.tsx b/frontend/src/app/Conditional.tsx index 750e6dc..f6b96a9 100644 --- a/frontend/src/app/Conditional.tsx +++ b/frontend/src/app/Conditional.tsx @@ -1,16 +1,14 @@ import { ReactNode } from 'react'; -interface ConditionalProps -{ +interface ConditionalProps { Condition: boolean; children: ReactNode; } -export default function Conditional({Condition, children} : ConditionalProps): JSX.Element -{ +export default function Conditional({ Condition, children }: ConditionalProps): JSX.Element { if (Condition) return (<>{children}); - + return <>; } diff --git a/frontend/src/app/EventsOnHomePage/Carosel.tsx b/frontend/src/app/EventsOnHomePage/Carosel.tsx index 2be07ed..af98d36 100644 --- a/frontend/src/app/EventsOnHomePage/Carosel.tsx +++ b/frontend/src/app/EventsOnHomePage/Carosel.tsx @@ -14,9 +14,9 @@ import { experimental_useEffectEvent, useEffect, useState } from "react"; import { useAppDispatch, useAppSelector } from "../hooks/hooks"; import { SetCurrentPage } from "../slices/pageSlice"; -import { fetchEventsAsync } from "../thunks/EventThunks"; +// import { fetchEventsAsync } from "../thunks/EventThunks"; import { AppDispatch } from "../stores/store"; -import { CalendarEvent, DefaultCalendarEvent, SetCalendarEvents, SetCurrentEvent, SetFetchIntervalStarted, selectEvent } from "../slices/eventSlice"; +// import { CalendarEvent, DefaultCalendarEvent, SetCalendarEvents, SetCurrentEvent, SetFetchIntervalStarted, selectEvent } from "../slices/eventSlice"; import { Timer } from "../hacks/Timer"; import { DropdownMenu, DropdownMenuTrigger, DropdownMenuItem, DropdownMenuContent } from "@/components/ui/dropdown-menu"; import Conditional from "../Conditional"; @@ -27,11 +27,9 @@ import { Button } from "@/components/ui/button"; import { Select, SelectItem, SelectTrigger, SelectContent } from "@/components/ui/select"; import EventInstance from "./EventForCarousel" -interface EventsProps { - Events: CalendarEvent[]; - - -} +// interface EventsProps { +// // Events: CalendarEvent[]; +// } export class Range { Start: number; @@ -58,29 +56,29 @@ export function CarouselMy() { const router = useRouter(); const mainDispatch = useAppDispatch(); - const event = useAppSelector(selectEvent); + // const event = useAppSelector(selectEvent); mainDispatch(SetCurrentPage("/events")); const [currentYear, setCurrentYear] = useState(new Date().getFullYear()); - const [loading, setLoading] = useState(event.Events.length < 1); + // const [loading, setLoading] = useState(event.Events.length < 1); const [currentEvent, setCurrentEvent] = useState(""); - useEffect(() => { - (async () => { - console.log("Fetching events."); - if (event.Events.length < 1) { - const fetchedEvents: CalendarEvent[] = (await mainDispatch(fetchEventsAsync() as AppDispatch)) as unknown as CalendarEvent[]; + // useEffect(() => { + // (async () => { + // console.log("Fetching events."); + // if (event.Events.length < 1) { + // const fetchedEvents: CalendarEvent[] = (await mainDispatch(fetchEventsAsync() as AppDispatch)) as unknown as CalendarEvent[]; - mainDispatch(SetCalendarEvents(fetchedEvents)); - setLoading(false); - } - })(); - }); + // mainDispatch(SetCalendarEvents(fetchedEvents)); + // setLoading(false); + // } + // })(); + // }); @@ -139,26 +137,26 @@ export function CarouselMy() { - + {/* Loading - + */} {/* event.Start.getFullYear() == currentYear)} /> */} { - [...event.Events] - .filter(event => event.Start.getFullYear() == currentYear) - .sort((a, b) => b.Start.getTime() - a.Start.getTime()) - .slice(0, 4) - .map((event, index) => ( - - - - )) + // [...event.Events] + // .filter(event => event.Start.getFullYear() == currentYear) + // .sort((a, b) => b.Start.getTime() - a.Start.getTime()) + // .slice(0, 4) + // .map((event, index) => ( + // + // + // + // )) } - +{/*
More Events Here @@ -167,7 +165,7 @@ export function CarouselMy() { - + */} diff --git a/frontend/src/app/EventsOnHomePage/Decision.tsx b/frontend/src/app/EventsOnHomePage/Decision.tsx index 6bb94c3..6c6c829 100644 --- a/frontend/src/app/EventsOnHomePage/Decision.tsx +++ b/frontend/src/app/EventsOnHomePage/Decision.tsx @@ -19,16 +19,18 @@ function Decision() { return (
{isWideScreen ? ( - + - - + + ) : (
+ {/* carouselMy might be broken */} +
- + )}
); diff --git a/frontend/src/app/EventsOnHomePage/EventeSection.tsx b/frontend/src/app/EventsOnHomePage/EventeSection.tsx index b85422f..0644752 100644 --- a/frontend/src/app/EventsOnHomePage/EventeSection.tsx +++ b/frontend/src/app/EventsOnHomePage/EventeSection.tsx @@ -1,28 +1,6 @@ -import { experimental_useEffectEvent, useEffect, useState } from "react"; import { useAppDispatch, useAppSelector } from "../hooks/hooks"; import { SetCurrentPage } from "../slices/pageSlice"; -import Events from "./Events"; -import { fetchEventsAsync } from "../thunks/EventThunks"; -import { AppDispatch } from "../stores/store"; -import { CalendarEvent, DefaultCalendarEvent, SetCalendarEvents, SetCurrentEvent, SetFetchIntervalStarted, selectEvent } from "../slices/eventSlice"; -import { Timer } from "../hacks/Timer"; -import { DropdownMenu, DropdownMenuTrigger, DropdownMenuItem, DropdownMenuContent } from "@/components/ui/dropdown-menu"; -import Conditional from "../Conditional"; -import IconLabel from "../IconLabel"; import { useRouter } from "next/navigation"; -import Image from "next/image" -import { Button } from "@/components/ui/button"; -import { Select, SelectItem, SelectTrigger, SelectContent } from "@/components/ui/select"; -import { - Dialog, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "@/components/ui/dialog"; - export class Range { Start: number; @@ -48,26 +26,15 @@ export default function EventsSection() { const router = useRouter(); const mainDispatch = useAppDispatch(); - const event = useAppSelector(selectEvent); - mainDispatch(SetCurrentPage("/events")); - const [currentYear, setCurrentYear] = useState(new Date().getFullYear()); - - const [loading, setLoading] = useState(event.Events.length < 1); - - useEffect(() => { - (async () => { - console.log("Fetching events."); - if (event.Events.length < 1) { - const fetchedEvents: CalendarEvent[] = (await mainDispatch(fetchEventsAsync() as AppDispatch)) as unknown as CalendarEvent[]; - - mainDispatch(SetCalendarEvents(fetchedEvents)); - setLoading(false); - } - })(); - }); - + const iframeStyle = { + border: '1px solid black', + borderRadius: '4px', + boxShadow: '0px 0px 3px 1px black ', + height: `760px`, + width: '500px' + }; const getYearsSince = (year: number) => { return new Range(year, new Date().getFullYear() + 1).ToArray(); @@ -94,26 +61,43 @@ export default function EventsSection() {
-
-
-
- -
- - - -
Events
- See more events - -
+
Events
+ {/* add Luma Event Iframes here */} +
+