Skip to content

Commit bc584b7

Browse files
Merge branch 'main' into HMT-172-add-major-field-to-participant-profile
2 parents c2a9433 + f691329 commit bc584b7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/UserProfile/UserForm.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ type UserFormData = {
1313
lastName: string;
1414
email: string;
1515
institution: string;
16+
progam: string;
1617
willEatMeals: boolean;
1718
allergies: string;
1819
};
@@ -23,6 +24,7 @@ const getFormValues = (userDetails: any): UserFormData => ({
2324
lastName: userDetails?.lastName || "",
2425
email: userDetails?.email || "",
2526
institution: userDetails?.institution || "",
27+
program: userDetails?.program || "",
2628
willEatMeals: Boolean(userDetails?.willEatMeals),
2729
allergies: userDetails?.allergies || "",
2830
});
@@ -153,10 +155,8 @@ export default function UserForm({
153155
<input
154156
className={`${"md:text-md my-2 rounded-full border-4 border-white bg-white py-2 ps-3 text-sm"} ${isEditing ? "text-black" : "text-ehhh-grey"}`}
155157
type="text"
156-
placeholder={formState.program ?? "e.g. Engineering"}
157-
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e)}
158-
value={formState.program ?? ""}
159-
name="program"
158+
placeholder={"e.g. Engineering"}
159+
{...register("program")}
160160
disabled={!isEditing} // Disabled when not in edit mode
161161
/>
162162
<label>Do you want provided meals at the hackathon?</label>

0 commit comments

Comments
 (0)