1import Link from "next/link";
2import { DateTime } from "luxon";
8} from "../components/Snippets";
17export default function EventPreview({ event, className, big }) {
18 // Event tiles have a 'dark mode' used when their background images are dark and white text is needed for legibility.
19 const grayText = event?.dark ? "text-washedWhite" : "text-wall-400";
20 const blackText = event?.dark ? "text-white" : "text-wall-600";
22 const starts = generateDisplayDate(event.starts, event.timezone);
23 const ends = generateDisplayDate(event.ends, event.timezone);
25 const inFuture = generateRealtimeDate(starts) > DateTime.now();
28 generateRealtimeDate(event.starts) > DateTime.now() && !inFuture;
32 className={`cursor-pointer aspect-w-4 aspect-h-5 md:aspect-w-5 md:aspect-h-4 ${className}`}
36 className={`bg-wall-100 rounded-xl bg-cover bg-center bg-no-repeat `}
37 style={{ backgroundImage: `url(${event.image})` || "" }}
39 <Link href={`/events/${event.slug}`}>
41 className={`flex flex-col p-6 justify-between items-between h-full relative`}
44 className={`flex-grow-1 flex ${
45 big ? "justify-center" : ""
48 <h3 className={`${blackText} mb-2`}>{event.title}</h3>
49 <p className={`${blackText} mb-2`}>{event.location}</p>
53 className={`${grayText} type-sub`}
57 <div className="absolute p-6 left-0 bottom-0 w-full pr-32">
58 <ShowOrHide condition={event.hosts}>
59 <p className={blackText + " type-sub"}>
62 {event.hosts?.map((host, index) => (
64 key={`${host.name}-${host.patp}`}
65 nameClassNames={blackText}
66 patpClassNames={blackText}
74 <ShowOrHide condition={event.guests}>
75 <p className={blackText + " type-sub"}>
77 {event.guests?.length > 1 ? "With guests " : "With guest "}
80 {event.guests?.map((guest, index) => (
82 key={`${guest.name}-${guest.patp}`}
83 nameClassNames={blackText}
84 patpClassNames={blackText}
94 {inFuture && event.registration_url ? (
95 <div className="absolute right-0 bottom-0 p-6">
97 className="button-sm bg-green-400 text-white"
98 href={event.registration_url}
99 onClick={(e) => e.stopPropagation()}
105 ) : event.youtube ? (
106 <div className="absolute right-0 bottom-0 p-6">
108 className="button-sm bg-wall-600 text-white"
109 href={`https://www.youtube.com/watch?v=${event.youtube}`}
110 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