Skip to content

Commit f4c52f6

Browse files
committed
fix: long event description should be 230 characters max
1 parent 77b43fe commit f4c52f6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/EventCard.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ const EventCard = ({
4040
new Date(endDate?.replace(/-/g, "/"))
4141
)
4242

43+
const MAX_DESCRIPTION_CHARS = 230
44+
const truncatedDescription =
45+
description.length > MAX_DESCRIPTION_CHARS
46+
? `${description.slice(0, MAX_DESCRIPTION_CHARS)}...`
47+
: description
48+
4349
return (
4450
<Box
4551
className={className}
@@ -108,7 +114,7 @@ const EventCard = ({
108114
</Text>
109115
</Box>
110116
<Box>
111-
<Text fontSize="sm">{description}</Text>
117+
<Text fontSize="sm">{truncatedDescription}</Text>
112118
</Box>
113119
</Box>
114120
</Box>

0 commit comments

Comments
 (0)