blob: 81f37fc7805f9ed7be4abeee86041e56aef55896 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
import { useState } from 'react';
import Button from '@mui/material/Button';
import Paper from '@mui/material/Paper';
import Grid from '@mui/material/Grid';
import TextField from '@mui/material/TextField';
import Typography from '@mui/material/Typography';
import Radio from '@mui/material/Radio';
import RadioGroup from '@mui/material/RadioGroup';
import FormControlLabel from '@mui/material/FormControlLabel';
import FormControl from '@mui/material/FormControl';
import FormLabel from '@mui/material/FormLabel';
function Rsvp() {
const [guestList, setGuestList] = useState([]);
const onAddBtnClick = event => {
setGuestList(guestList.concat(
<Grid container spacing={2}>
<Grid item xs={6} md={6} lg={6}>
<TextField key={guestList.length} label="Name" variant="outlined" />
</Grid>
<Grid item xs={6} md={6} lg={6}>
<FormControl>
<FormLabel>Meal Preference</FormLabel>
<RadioGroup>
<FormControlLabel
value="Beef"
control={<Radio />}
label="Beef"
/>
<FormControlLabel
value="Chicken"
control={<Radio />}
label="Chicken"
/>
<FormControlLabel
value="Fish"
control={<Radio />}
label="Fish"
/>
<FormControlLabel
value="Vegetarian"
control={<Radio />}
label="Vegetarian"
/>
</RadioGroup>
</FormControl>
</Grid>
</Grid>
));
}
return (
<Paper>
<Grid container spacing={2}>
<Grid item xs={4} md={4} lg={4}>
<Typography>Date: April 14, 2025</Typography>
</Grid>
<Grid item xs={4} md={4} lg={4}>
<Typography>Location: </Typography>
</Grid>
<Grid item xs={4} md={4} lg={4}>
<Typography>RSVP Deadline: </Typography>
</Grid>
<Grid item xs={4} md={4} lg={4}>
<TextField required label="Name" variant="outlined" />
</Grid>
<Grid item xs={4} md={4} lg={4}>
<FormControl>
<FormLabel>Are you attending?</FormLabel>
<RadioGroup>
<FormControlLabel value="Yes" control={<Radio />} label="Yes" />
<FormControlLabel value="No" control={<Radio />} label="No" />
</RadioGroup>
</FormControl>
</Grid>
<Grid item xs={4} md={4} lg={4}>
<Button
onClick={onAddBtnClick}
sx={{ maxWidth: 240 }}
variant="contained">
Add Additional Guests
{/* TODO: only allow guests we've selected; allow kids? */}
</Button>
</Grid>
{guestList}
<Grid item xs={6} md={6} lg={6}>
<TextField
label="Dietary Restrictions"
variant="outlined"
/>
</Grid>
<Grid item xs={6} md={6} lg={6}>
<TextField
label="Song Request"
variant="outlined"
/>
</Grid>
<Grid item>
<Button sx={{ maxWidth: 80 }} variant="contained">Submit</Button>
</Grid>
</Grid>
</Paper>
);
}
export default Rsvp;
|