Adding info to RSVP form and back to events list button
This commit is contained in:
@@ -446,6 +446,25 @@ const RSVPForm: React.FC = () => {
|
|||||||
RSVP Form
|
RSVP Form
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
|
{event && (
|
||||||
|
<Box sx={{ mb: 3, textAlign: 'center' }}>
|
||||||
|
<Typography variant="h5" component="h3" gutterBottom>
|
||||||
|
{event.title}
|
||||||
|
</Typography>
|
||||||
|
{event.description && (
|
||||||
|
<Typography variant="body2" color="text.secondary">
|
||||||
|
<strong>Info:</strong> {event.description}
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
|
<Typography variant="body2" color="text.secondary">
|
||||||
|
<strong>Date:</strong> {new Date(event.date).toLocaleString()}
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="body2" color="text.secondary">
|
||||||
|
<strong>Location:</strong> {event.location}
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
|
||||||
{error && (
|
{error && (
|
||||||
<Typography color="error" align="center" sx={{ mb: 2 }}>
|
<Typography color="error" align="center" sx={{ mb: 2 }}>
|
||||||
{error}
|
{error}
|
||||||
@@ -652,11 +671,19 @@ const RSVPForm: React.FC = () => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
||||||
|
<Box sx={{ display: 'flex', justifyContent: 'space-between', mt: 2, gap: 2 }}>
|
||||||
|
<Button
|
||||||
|
variant="outlined"
|
||||||
|
color="primary"
|
||||||
|
onClick={() => navigate('/')}
|
||||||
|
sx={{ flexGrow: 1 }}
|
||||||
|
>
|
||||||
|
Back to Events List
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="large"
|
|
||||||
disabled={isSubmitting ||
|
disabled={isSubmitting ||
|
||||||
!formData.name.trim() ||
|
!formData.name.trim() ||
|
||||||
!formData.email_address.trim() ||
|
!formData.email_address.trim() ||
|
||||||
@@ -664,11 +691,12 @@ const RSVPForm: React.FC = () => {
|
|||||||
(formData.attending === 'yes' && !formData.bringing_guests) ||
|
(formData.attending === 'yes' && !formData.bringing_guests) ||
|
||||||
(formData.bringing_guests === 'yes' && (formData.guest_count < 1 || formData.guest_names.some(name => !name.trim())))
|
(formData.bringing_guests === 'yes' && (formData.guest_count < 1 || formData.guest_names.some(name => !name.trim())))
|
||||||
}
|
}
|
||||||
sx={{ mt: 2 }}
|
sx={{ flexGrow: 1 }}
|
||||||
>
|
>
|
||||||
{isSubmitting ? 'Submitting...' : 'Submit RSVP'}
|
{isSubmitting ? 'Submitting...' : 'Submit RSVP'}
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
|
</Box>
|
||||||
</Paper>
|
</Paper>
|
||||||
</Container>
|
</Container>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
Reference in New Issue
Block a user