Skip to content

Commit 0dbdbe2

Browse files
committed
create status component, compose all student components, refactor registration form
1 parent 051c256 commit 0dbdbe2

File tree

3 files changed

+30
-16
lines changed

3 files changed

+30
-16
lines changed

frontend/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@radix-ui/react-separator": "^1.1.7",
1919
"@radix-ui/react-slot": "^1.2.3",
2020
"@radix-ui/react-tabs": "^1.1.13",
21-
"@tanstack/react-query": "^5.90.7",
21+
"@tanstack/react-query": "^5.90.10",
2222
"@tanstack/react-table": "^8.21.3",
2323
"axios": "^1.12.2",
2424
"class-variance-authority": "^0.7.1",

frontend/src/components/PartyRegistrationForm.tsx

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const partyFormSchema = z.object({
4646
"Party must be at least 2 business days in the future"
4747
),
4848
partyTime: z.string().min(1, "Party time is required"),
49+
secondContactName: z.string().min(1, "Name is required"),
4950
phoneNumber: z
5051
.string()
5152
.min(1, "Phone number is required")
@@ -160,9 +161,8 @@ export default function PartyRegistrationForm({
160161
<Button
161162
id="party-date"
162163
variant="outline"
163-
className={`w-full justify-start text-left font-normal ${
164-
!formData.partyDate && "text-muted-foreground"
165-
}`}
164+
className={`w-full justify-start text-left font-normal ${!formData.partyDate && "text-muted-foreground"
165+
}`}
166166
>
167167
{formData.partyDate ? (
168168
format(formData.partyDate, "PPP")
@@ -206,8 +206,22 @@ export default function PartyRegistrationForm({
206206
</Field>
207207
</div>
208208

209+
<Field data-invalid={!!errors.secondContactName}>
210+
<FieldLabel htmlFor="second-contact-name">Second Contact name</FieldLabel>
211+
<Input
212+
id="phone-number"
213+
placeholder=""
214+
value={formData.secondContactName}
215+
onChange={(e) => updateField("secondContactName", e.target.value)}
216+
aria-invalid={!!errors.secondContactName}
217+
/>
218+
{errors.phoneNumber && (
219+
<FieldError>{errors.phoneNumber}</FieldError>
220+
)}
221+
</Field>
222+
209223
<Field data-invalid={!!errors.phoneNumber}>
210-
<FieldLabel htmlFor="phone-number">Your Phone Number</FieldLabel>
224+
<FieldLabel htmlFor="phone-number">Second Contact Phone Number</FieldLabel>
211225
<Input
212226
id="phone-number"
213227
placeholder="(123) 456-7890"
@@ -216,7 +230,7 @@ export default function PartyRegistrationForm({
216230
aria-invalid={!!errors.phoneNumber}
217231
/>
218232
<FieldDescription>
219-
We will use this to contact you about the party
233+
We will use this to contact Contact two about the party
220234
</FieldDescription>
221235
{errors.phoneNumber && (
222236
<FieldError>{errors.phoneNumber}</FieldError>
@@ -225,7 +239,7 @@ export default function PartyRegistrationForm({
225239

226240
<Field data-invalid={!!errors.contactPreference}>
227241
<FieldLabel htmlFor="contact-preference">
228-
Contact Preference
242+
Second Contact Contact Preference
229243
</FieldLabel>
230244
<Select
231245
value={formData.contactPreference}
@@ -241,7 +255,7 @@ export default function PartyRegistrationForm({
241255
<SelectItem value="text">Text</SelectItem>
242256
</SelectContent>
243257
</Select>
244-
<FieldDescription>How should we contact you?</FieldDescription>
258+
<FieldDescription>How should we contact the second contact?</FieldDescription>
245259
{errors.contactPreference && (
246260
<FieldError>{errors.contactPreference}</FieldError>
247261
)}

0 commit comments

Comments
 (0)