diff --git a/src/app/student/_components/EventItem.tsx b/src/app/student/_components/EventItem.tsx index adbcfd8..c83a003 100644 --- a/src/app/student/_components/EventItem.tsx +++ b/src/app/student/_components/EventItem.tsx @@ -1,9 +1,8 @@ -import { AccordionItem, AccordionTrigger } from "@/components/ui/accordion" +import { Card } from "@/components/ui/card" import { cn } from "@/lib/utils" import { DateTime } from "luxon" export function EventItem({ - children, EventTitle, open_for_signup, registration_required, @@ -12,6 +11,7 @@ export function EventItem({ registration_end, image_url }: { + id: string children?: React.ReactNode EventTitle: string open_for_signup: boolean @@ -21,15 +21,11 @@ export function EventItem({ registration_end: number image_url: string }) { - const expandable = children != null + const expandable = false return ( - +
- - -
+ + ) } diff --git a/src/app/student/_components/EventsTimeLine.tsx b/src/app/student/_components/EventsTimeLine.tsx index a4ed4f2..d18e5f8 100644 --- a/src/app/student/_components/EventsTimeLine.tsx +++ b/src/app/student/_components/EventsTimeLine.tsx @@ -1,20 +1,19 @@ -import { P } from "@/app/_components/Paragraph" -import { fetchDates } from "@/components/shared/hooks/api/useDates" -import { Accordion } from "@/components/ui/accordion" -import { Button } from "@/components/ui/button" - import { EventItem } from "@/app/student/_components/EventItem" -import { DateTime } from "luxon" -import Link from "next/link" - -function formatDate(date: string) { - return DateTime.fromISO(date).toFormat( - `d MMMM ${DateTime.fromISO(date).year !== DateTime.now().year ? " YYYY" : ""}` - ) -} +import { Event } from "@/components/shared/hooks/api/useEvents" +import { Accordion } from "@/components/ui/accordion" -export async function EventsTimeline() { - const dates = await fetchDates() +export async function EventsTimeline({ events }: { events: Event[] }) { + const renderEvent = events.map(event => ( + + )) //ASSUMPTION: the start date will be first for fair dates return ( @@ -22,60 +21,7 @@ export async function EventsTimeline() { type="single" collapsible={true} className="relative mt-10 border-s border-melon-700"> - -

- Before the Initial Registration can open, we need to make - preparations. We are right now choosing a new project group - 20 - something students who will work hard all year to make Armada happen. -

-

- We will open Initial Registration where you apply to be an exhibitor - soon. You can express your interest here, and we will contact you as - soon as registration opens! -

-
- - -

- Initial Registration is where you apply to be an exhibitor. When you - register you commit to be a part of Armada and if given a spot you are - expected to exhibit, so wait with registration until you are sure. If - you have any questions, do not hesitate to contact{" "} - - sales@armada.nu - - . -

-

- Sadly, we can't guarantee a spot for everyone that applies. We - are right now investigating how many exhibitors we can fit and how big - the interest is. We try our best to get a good mix of great exhibitors - that make Armada the best place for students to find their dream - employer! -

-

- During the Initial Registration you don't need to choose a - package, and the packages are outlined{" "} - - here - {" "} - to give you an overview. Prices are set, and small changes can occur - in the larger packages. -

-
- - - -
-
+ {renderEvent} ) } diff --git a/src/app/student/events/page.tsx b/src/app/student/events/page.tsx index 15f23ba..279119d 100644 --- a/src/app/student/events/page.tsx +++ b/src/app/student/events/page.tsx @@ -1,14 +1,18 @@ import { EventsTimeline } from "@/app/student/_components/EventsTimeLine" import { Page } from "@/components/shared/Page" +import { fetchEvents } from "@/components/shared/hooks/api/useEvents" import { Suspense } from "react" export default async function StudentEventPage() { + const events = await fetchEvents() + console.log(events) return ( Events - - + + + )