diff --git a/frontend/src/components/EventForm.tsx b/frontend/src/components/EventForm.tsx index 940bcde..cfbae36 100644 --- a/frontend/src/components/EventForm.tsx +++ b/frontend/src/components/EventForm.tsx @@ -12,6 +12,7 @@ import { styled, Checkbox, FormControlLabel, + Divider, // Added Divider for visual separation } from '@mui/material'; import WallpaperIcon from '@mui/icons-material/Wallpaper'; import DeleteIcon from '@mui/icons-material/Delete'; @@ -48,6 +49,7 @@ interface FormData { max_guests_per_rsvp: number; email_notifications_enabled: boolean; email_recipients: string; + thank_you_message: string; // Added thank you message field } const EventForm: React.FC = () => { @@ -62,6 +64,7 @@ const EventForm: React.FC = () => { max_guests_per_rsvp: 0, email_notifications_enabled: false, email_recipients: '', + thank_you_message: '', // Added thank you message state }); const [wallpaper, setWallpaper] = useState(null); const [currentItem, setCurrentItem] = useState(''); @@ -123,6 +126,9 @@ const EventForm: React.FC = () => { } }); + // Append thank you message + submitData.append('thank_you_message', formData.thank_you_message); + // Append wallpaper if selected if (wallpaper) { submitData.append('wallpaper', wallpaper); @@ -154,196 +160,215 @@ const EventForm: React.FC = () => { Create New Event - + {error && ( {error} )} - - - - - - - { - const value = parseInt(e.target.value); - setFormData((prev) => ({ - ...prev, - max_guests_per_rsvp: isNaN(value) ? 0 : value, - })); - }} - variant="outlined" - helperText="Set to 0 for no additional guests, -1 for unlimited" - inputProps={{ min: -1 }} - /> - - - - - Event Wallpaper + + {/* Part 1: Basic Event Details */} + + + Basic Event Details - - - {wallpaper && ( - setWallpaper(null)} - size="small" - sx={{ - color: '#f44336', - '&:hover': { - backgroundColor: 'rgba(244, 67, 54, 0.08)', - } - }} - > - - - )} - - {wallpaper && ( - - Selected: {wallpaper.name} - - )} - - - - - - Needed Items - - + - - - - {formData.needed_items.map((item, index) => ( - handleRemoveItem(index)} - sx={{ - bgcolor: 'rgba(144, 202, 249, 0.2)', - color: 'rgba(255, 255, 255, 0.9)', - '& .MuiChip-deleteIcon': { - color: 'rgba(255, 255, 255, 0.7)', - '&:hover': { - color: 'rgba(255, 255, 255, 0.9)', - } - } - }} - /> - ))} + /> + + { + const value = parseInt(e.target.value); + setFormData((prev) => ({ + ...prev, + max_guests_per_rsvp: isNaN(value) ? 0 : value, + })); + }} + variant="outlined" + helperText="Set to 0 for no additional guests, -1 for unlimited" + inputProps={{ min: -1 }} + /> - - - Email Notifications + + + {/* Part 2: Customization */} + + + Customization - - + + + + Event Wallpaper + + + + {wallpaper && ( + setWallpaper(null)} + size="small" + sx={{ + color: '#f44336', + '&:hover': { + backgroundColor: 'rgba(244, 67, 54, 0.08)', + } + }} + > + + + )} + + {wallpaper && ( + + Selected: {wallpaper.name} + + )} + + + + + + Needed Items + + + + + + + {formData.needed_items.map((item, index) => ( + handleRemoveItem(index)} + sx={{ + bgcolor: 'rgba(144, 202, 249, 0.2)', + color: 'rgba(255, 255, 255, 0.9)', + '& .MuiChip-deleteIcon': { + color: 'rgba(255, 255, 255, 0.7)', + '&:hover': { + color: 'rgba(255, 255, 255, 0.9)', + } + } + }} + /> + ))} + + + + + + + + {/* Part 3: Notifications and Messaging */} + + + Notifications and Messaging + + { color: 'rgba(255, 255, 255, 0.9)', }} /> - - - {formData.email_notifications_enabled && ( + + {formData.email_notifications_enabled && ( + + )} + - )} +