From 765da97b520dd822b0cb66ff5cce21686be6a9b5 Mon Sep 17 00:00:00 2001 From: Starstrike Date: Tue, 29 Apr 2025 19:56:17 -0400 Subject: [PATCH] Update EventDetails and RSVPForm components with needed items functionality and improved styling --- frontend/src/components/EventDetails.tsx | 6 +++--- frontend/src/components/RSVPForm.tsx | 26 +++++++++++++----------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/EventDetails.tsx b/frontend/src/components/EventDetails.tsx index e1526a5..39a550b 100644 --- a/frontend/src/components/EventDetails.tsx +++ b/frontend/src/components/EventDetails.tsx @@ -181,9 +181,9 @@ const EventDetails: React.FC = () => { Bringing {rsvp.guest_count} guest{rsvp.guest_count !== 1 ? 's' : ''}: {rsvp.guest_names} )} - {rsvp.items_bringing && ( - - Items: {rsvp.items_bringing} + {rsvp.items_bringing && rsvp.items_bringing.length > 0 && ( + + Items: {Array.isArray(rsvp.items_bringing) ? rsvp.items_bringing.join(', ') : rsvp.items_bringing} )} diff --git a/frontend/src/components/RSVPForm.tsx b/frontend/src/components/RSVPForm.tsx index 3d61861..79289e6 100644 --- a/frontend/src/components/RSVPForm.tsx +++ b/frontend/src/components/RSVPForm.tsx @@ -73,10 +73,9 @@ const RSVPForm: React.FC = () => { const handleItemsChange = (e: SelectChangeEvent) => { const { value } = e.target; - const newValue = typeof value === 'string' ? value.split(',') : value; setFormData(prev => ({ ...prev, - items_bringing: Array.isArray(newValue) ? newValue : [], + items_bringing: Array.isArray(value) ? value : typeof value === 'string' ? value.split(',') : [], })); }; @@ -203,18 +202,21 @@ const RSVPForm: React.FC = () => {