on master help sign in
EventPreview: truncate description to one line
commitb7fe8bc7651e9eb247c617e3c7b4285247c6a0cf authorMatilde Park <matilde.park@urbit.org> dateWed 15 Jun 2022, 13:33 (4 years ago) parent25cc2c6
1 file changed+3−37
components/EventPreview.js+3−37
components/EventPreview.js+3−37
@@ -15,42 +15,6 @@ import {
1515 formatTimeZone,
1616} from "../lib/lib";
1717
18−// JAL(2021.9.13) Couldn't quite get this to work properly. There's a trailing
19−// "and"
20−//
21−// function GuestList({ guests, textClass }) {
22−
23−// const renderGuests = guests?.length > 2 ? guests?.slice(0,2) : guests;
24−// const noRenderGuestsCount = guests?.slice(2).length;
25−
26−// return (
27−// <p className={textClass + " type-sub"}>
28−// <b>
29−// {renderGuests?.length > 1 ? "With guests " : "With guest "}
30−// </b>
31−// <ReadableList>
32−// {renderGuests?.map((guest, index) => (
33−// <>
34−// <Person
35−// key={`${guest.name}-${guest.patp}`}
36−// nameClassNames={textClass}
37−// patpClassNames={textClass}
38−// name={guest.name}
39−// patp={guest.patp}
40−// />
41−// {renderGuests?.length > 1 ? <span>, </span> : <></>}
42−// </>
43−// ))}
44−// {noRenderGuestsCount > 1 ?
45−// <Name>{noRenderGuestsCount} more </Name>
46−// :
47−// <></>
48−// }
49−// </ReadableList>
50−// </p>
51−// );
52−// }
53−
5418export default function EventPreview({ event, className, big }) {
5519 // Event tiles have a 'dark mode' used when their background images are dark and white text is needed for legibility.
5620 const grayText = event?.dark ? "text-washedWhite" : "text-wall-400";
@@ -83,7 +47,9 @@ export default function EventPreview({ event, className, big }) {
8347 } flex-col h-full`}
8448 >
8549 <h3 className={`${blackText} mb-2`}>{event.title}</h3>
86− <p className={blackText + ""}>{event.description}</p>
50+ <p className={blackText + " truncate text-sm"}>
51+ {event.description}
52+ </p>
8753 </div>
8854
8955 <div className="absolute p-6 left-0 bottom-0 w-full pr-32">