Add email notification settings to event creation form
This commit is contained in:
@@ -10,6 +10,8 @@ import {
|
||||
Chip,
|
||||
IconButton,
|
||||
styled,
|
||||
Checkbox,
|
||||
FormControlLabel,
|
||||
} from '@mui/material';
|
||||
import WallpaperIcon from '@mui/icons-material/Wallpaper';
|
||||
import DeleteIcon from '@mui/icons-material/Delete';
|
||||
@@ -44,6 +46,8 @@ interface FormData {
|
||||
needed_items: string[];
|
||||
rsvp_cutoff_date: string;
|
||||
max_guests_per_rsvp: number;
|
||||
email_notifications_enabled: boolean;
|
||||
email_recipients: string;
|
||||
}
|
||||
|
||||
const EventForm: React.FC = () => {
|
||||
@@ -56,6 +60,8 @@ const EventForm: React.FC = () => {
|
||||
needed_items: [],
|
||||
rsvp_cutoff_date: '',
|
||||
max_guests_per_rsvp: 0,
|
||||
email_notifications_enabled: false,
|
||||
email_recipients: '',
|
||||
});
|
||||
const [wallpaper, setWallpaper] = useState<File | null>(null);
|
||||
const [currentItem, setCurrentItem] = useState('');
|
||||
@@ -218,6 +224,46 @@ const EventForm: React.FC = () => {
|
||||
helperText="Set to 0 for no additional guests, -1 for unlimited"
|
||||
inputProps={{ min: -1 }}
|
||||
/>
|
||||
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', mt: 2 }}>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={formData.email_notifications_enabled}
|
||||
onChange={(e) => {
|
||||
setFormData((prev) => ({
|
||||
...prev,
|
||||
email_notifications_enabled: e.target.checked,
|
||||
}));
|
||||
}}
|
||||
sx={{
|
||||
color: 'rgba(255, 255, 255, 0.7)',
|
||||
'&.Mui-checked': {
|
||||
color: '#90caf9',
|
||||
},
|
||||
}}
|
||||
/>
|
||||
}
|
||||
label="Enable Email Notifications"
|
||||
sx={{
|
||||
color: 'rgba(255, 255, 255, 0.9)',
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
{formData.email_notifications_enabled && (
|
||||
<DarkTextField
|
||||
fullWidth
|
||||
label="Email Recipients (comma separated)"
|
||||
name="email_recipients"
|
||||
value={formData.email_recipients}
|
||||
onChange={handleChange}
|
||||
variant="outlined"
|
||||
placeholder="email1@example.com, email2@example.com"
|
||||
helperText="Enter email addresses separated by commas"
|
||||
sx={{ mt: 2 }}
|
||||
/>
|
||||
)}
|
||||
<DarkTextField
|
||||
fullWidth
|
||||
label="Location"
|
||||
|
||||
Reference in New Issue
Block a user