1import Link from "next/link";
2import { DateTime } from "luxon";
9} from "../components/Snippets";
18// JAL(2021.9.13) Couldn't quite get this to work properly. There's a trailing
21// function GuestList({ guests, textClass }) {
23// const renderGuests = guests?.length > 2 ? guests?.slice(0,2) : guests;
24// const noRenderGuestsCount = guests?.slice(2).length;
27// <p className={textClass + " type-sub"}>
29// {renderGuests?.length > 1 ? "With guests " : "With guest "}
32// {renderGuests?.map((guest, index) => (
35// key={`${guest.name}-${guest.patp}`}
36// nameClassNames={textClass}
37// patpClassNames={textClass}
41// {renderGuests?.length > 1 ? <span>, </span> : <></>}
44// {noRenderGuestsCount > 1 ?
45// <Name>{noRenderGuestsCount} more </Name>
54export default function EventPreview({ event, className, big }) {
55 // Event tiles have a 'dark mode' used when their background images are dark and white text is needed for legibility.
56 const grayText = event?.dark ? "text-washedWhite" : "text-wall-400";
57 const blackText = event?.dark ? "text-white" : "text-wall-600";
59 const starts = generateDisplayDate(event.starts, event.timezone);
60 const ends = generateDisplayDate(event.ends, event.timezone);
62 const inFuture = generateRealtimeDate(starts) > DateTime.now();
65 generateRealtimeDate(event.starts) > DateTime.now() && !inFuture;
69 className={`cursor-pointer aspect-w-4 aspect-h-5 md:aspect-w-5 md:aspect-h-4 ${className}`}
73 className={`bg-wall-100 rounded-xl bg-cover bg-center bg-no-repeat `}
74 style={{ backgroundImage: `url(${event.image})` || "" }}
76 <Link href={`/events/${event.slug}`}>
78 className={`flex flex-col p-6 justify-between items-between h-full relative`}
81 className={`flex-grow-1 flex ${
82 big ? "justify-center" : ""
85 <h3 className={`${blackText} mb-2`}>{event.title}</h3>
86 <p className={blackText + ""}>{event.description}</p>
89 <div className="absolute p-6 left-0 bottom-0 w-full pr-32">
90 <p className={`${blackText} type-sub mb-1`}>{event.location}</p>
94 className={`${grayText} type-sub`}
98 {inFuture && event.registration_url ? (
99 <div className="absolute right-0 bottom-0 p-6">
101 className="button-sm bg-green-400 text-white"
102 href={event.registration_url}
103 onClick={(e) => e.stopPropagation()}
109 ) : event.youtube ? (
110 <div className="absolute right-0 bottom-0 p-6">
112 className="button-sm bg-wall-600 text-white"
113 href={`https://www.youtube.com/watch?v=${event.youtube}`}
114 onClick={(e) => e.stopPropagation()}
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list