From 26b359f2c5f6dbe08f4718be07d040aabd78bbb5 Mon Sep 17 00:00:00 2001 From: Ninad-S <144244166+Ninad-S@users.noreply.github.com> Date: Tue, 29 Oct 2024 18:12:12 -0500 Subject: [PATCH] Changed events to full screen --- src/components/events/EventCard.tsx | 171 ++++------------------------ 1 file changed, 25 insertions(+), 146 deletions(-) diff --git a/src/components/events/EventCard.tsx b/src/components/events/EventCard.tsx index 4e73c25..c5a0e4f 100644 --- a/src/components/events/EventCard.tsx +++ b/src/components/events/EventCard.tsx @@ -1,159 +1,38 @@ 'use server'; -import { format, isSameDay } from 'date-fns'; -import Image from 'next/image'; -import Link from 'next/link'; -import { MoreIcon } from '@src/icons/Icons'; -import { type RouterOutputs } from '@src/trpc/shared'; -import EventLikeButton from './EventLikeButton'; -import { getServerAuthSession } from '@src/server/auth'; -import dynamic from 'next/dynamic'; - -const EventTimeAlert = dynamic(() => import('./EventTimeAlert'), { - ssr: false, -}); -type EventCardProps = { - event: RouterOutputs['event']['findByFilters']['events'][number]; -}; +import EventCard from '@src/components/events/EventCard'; +import { api } from '@src/trpc/server'; +import Link from 'next/link'; -const HorizontalCard = async ({ - event, -}: { - event: RouterOutputs['event']['findByFilters']['events'][number]; -}) => { - const session = await getServerAuthSession(); - return ( -
-
-
- event image -
-
- -
-
-
-
-

{event.name}

-

- - {event.club.name} - {' '} - • - - {format(event.startTime, 'E, MMM d, p')} - {isSameDay(event.startTime, event.endTime) ? ( - <> - {format(event.endTime, 'p')} - ) : ( - <> - {format(event.endTime, 'E, MMM d, p')} - )} - -

-

- {event.description} -

-
-
- {session && ( - - )} +const CommunityEvents = async () => { + const events = await api.userMetadata.getEvents(); + if (events.length === 0) { + return ( +
+
You haven't added any community events yet 😭
+
+ You can check out new events{' '} - + here
-
- ); -}; - -const VerticalCard = async ({ - event, -}: { - event: RouterOutputs['event']['findByFilters']['events'][number]; -}) => { - const session = await getServerAuthSession(); + ); + } return ( -
-
-
- event image -
- -
+
+ {events.map((event) => ( +
+
-
-
-
-

{event.name}

-

- - {event.club.name} - -
- - {format(event.startTime, 'E, MMM d, p')} - {isSameDay(event.startTime, event.endTime) ? ( - <> - {format(event.endTime, 'p')} - ) : ( - <> - {' '} - -
- {format(event.endTime, 'E, MMM d, p')} - - )} -
-
-

-
-
- - - - {session && ( - - )} -
-
-
- ); -}; - -const EventCard = ({ event }: EventCardProps) => { - return ( -
-
- -
-
- -
+ ))}
); }; -export default EventCard; +export default CommunityEvents;