From 48ee7a956c39733b90bf26698071a7193df60cb9 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Tue, 20 Sep 2022 13:37:34 +0100 Subject: [PATCH] Fixes #4606 - Add guests cannot be removed (#4609) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../components/booking/pages/BookingPage.tsx | 108 +++++++++--------- 1 file changed, 52 insertions(+), 56 deletions(-) diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsx index b89182af17..552c549379 100644 --- a/apps/web/components/booking/pages/BookingPage.tsx +++ b/apps/web/components/booking/pages/BookingPage.tsx @@ -734,62 +734,58 @@ const BookingPage = ({ )} ))} - {!eventType.disableGuests && ( + {!eventType.disableGuests && guestToggle && (
- {guestToggle && ( -
- - {!disableInput && ( - ( - guest@example.com - } - emails={value} - onChange={onChange} - getLabel={( - email: string, - index: number, - removeEmail: (index: number) => void - ) => { - return ( -
- {email} - {!disableInput && ( - removeEmail(index)}> - × - - )} -
- ); - }} - /> - )} - /> - )} - {/* Custom code when guest emails should not be editable */} - {disableInput && guestListEmails && guestListEmails.length > 0 && ( -
- {/* // @TODO: user owners are appearing as guest here when should be only user input */} - {guestListEmails.map((email, index) => { - return ( -
- {email} -
- ); - })} -
- )} -
- )} +
+ + {!disableInput && ( + ( + guest@example.com} + emails={value} + onChange={onChange} + getLabel={( + email: string, + index: number, + removeEmail: (index: number) => void + ) => { + return ( +
+ {email} + {!disableInput && ( + removeEmail(index)}> + × + + )} +
+ ); + }} + /> + )} + /> + )} + {/* Custom code when guest emails should not be editable */} + {disableInput && guestListEmails && guestListEmails.length > 0 && ( +
+ {/* // @TODO: user owners are appearing as guest here when should be only user input */} + {guestListEmails.map((email, index) => { + return ( +
+ {email} +
+ ); + })} +
+ )} +
)} {isSmsReminderNumberNeeded && selectedLocationType !== LocationType.Phone && ( @@ -845,7 +841,7 @@ const BookingPage = ({
- {!guestToggle && ( + {!eventType.disableGuests && !guestToggle && (