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 */} +
+