Skip to content

Commit

Permalink
Finally get cards to be full width
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenOlano committed Nov 22, 2024
1 parent 2f90a39 commit 229f020
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/app/events/eventView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const EventView = ({ children, searchParams }: Props) => {

<section
aria-labelledby="events-heading"
className="container flex w-full flex-col overflow-x-clip sm:flex-row sm:space-x-7.5"
className="w-full"
>
<div
data-view="list"
Expand Down
41 changes: 20 additions & 21 deletions src/components/events/EventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,31 @@ const HorizontalCard = async ({
}) => {
const session = await getServerAuthSession();
return (
<div className="container flex h-40 flex-row overflow-hidden rounded-lg bg-white shadow-sm transition-shadow hover:shadow-lg">
<div className="relative h-[160px] w-1/3 max-w-[225px]">
<div className="h-[160px]">
<Image
fill
src={'/event_default.jpg'}
alt="event image"
className="object-cover object-left"
/>
</div>
<div className="absolute inset-0 p-2 text-white">
<div className="flex h-44 w-full flex-row overflow-hidden rounded-lg bg-white shadow-sm transition-all duration-200 hover:shadow-lg">
<div className="relative h-full w-1/3 max-w-[225px] overflow-hidden">
<Image
fill
src={'/event_default.jpg'}
alt="event image"
className="object-cover"
sizes="(max-width: 225px) 100vw, 225px"
/>
<div className="absolute inset-0 p-3">
<EventTimeAlert event={event} />
</div>
</div>
<div className="flex w-full flex-row px-6 py-5">
<div className="flex flex-col space-y-2.5">
<h3 className="font-bold">{event.name}</h3>
<h4 className="whitespace-nowrap text-xs font-bold">
<div className="flex w-full flex-row gap-4 px-6 py-5">
<div className="flex flex-col space-y-3">
<h3 className="text-lg font-bold leading-tight">{event.name}</h3>
<h4 className="flex flex-wrap items-center gap-x-2 text-sm font-medium">
<Link
href={`/directory/${event.clubId ?? ''}`}
className="hover:text-blue-primary"
scroll
>
{event.club.name}
</Link>{' '}
<wbr />
</Link>
<span className="text-gray-400"></span>
<span className="text-blue-primary">
{format(event.startTime, 'E, MMM d, p')}
{isSameDay(event.startTime, event.endTime) ? (
Expand All @@ -53,16 +52,16 @@ const HorizontalCard = async ({
)}
</span>
</h4>
<p className="line-clamp-3 overflow-clip text-ellipsis text-xs font-bold">
<p className="line-clamp-2 text-sm text-gray-600">
{event.description}
</p>
</div>
<div className="ml-auto flex flex-row space-x-4">
<div className="ml-auto flex flex-row items-start gap-3">
{session && (
<EventLikeButton liked={event.liked} eventId={event.id} />
)}
<Link
className=" h-10 w-10 rounded-full bg-blue-primary p-1.5 shadow-lg transition-colors hover:bg-blue-700 active:bg-blue-800"
className="flex h-10 w-10 items-center justify-center rounded-full bg-blue-primary shadow-md transition-colors hover:bg-blue-700 active:bg-blue-800"
href={`/event/${event.id}`}
passHref
>
Expand Down Expand Up @@ -140,7 +139,7 @@ const VerticalCard = async ({

const EventCard = ({ event }: EventCardProps) => {
return (
<div>
<div className="w-full">
<div className="hidden lg:group-data-[view=list]:contents">
<HorizontalCard event={event} />
</div>
Expand Down

0 comments on commit 229f020

Please sign in to comment.