From ce232d6256b4fe03c5b0665133be6ea524349c5c Mon Sep 17 00:00:00 2001 From: jyellapu Date: Wed, 19 Jul 2023 18:11:47 +0530 Subject: [PATCH] Add full names in the descripiton of dynamic events. --- .../bookings/Booker/components/EventMeta.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/features/bookings/Booker/components/EventMeta.tsx b/packages/features/bookings/Booker/components/EventMeta.tsx index d89044ed0a..c7993a398c 100644 --- a/packages/features/bookings/Booker/components/EventMeta.tsx +++ b/packages/features/bookings/Booker/components/EventMeta.tsx @@ -55,6 +55,21 @@ export const EventMeta = () => { ? "text-yellow-500" : "text-bookinghighlight"; + if (!isLoading && !!event && event?.isDynamic) { + const numUsers = event.users.length; + let dynamicEventDescription = event.description; + if (numUsers > 1) { + if (numUsers == 1) { + dynamicEventDescription = event.users[0].name; + } else if (numUsers == 2) { + dynamicEventDescription = [event.users[0].name, event.users[1].name].join(", "); + } else { + dynamicEventDescription = [event.users[0].name, event.users[1].name].join(", ") + " & more"; + } + event.description = dynamicEventDescription; + } + } + return (
{isLoading && (