From 1ba445c752f1f7cfbb6813de21c31e08e1473203 Mon Sep 17 00:00:00 2001 From: Jacob Taegon Kim Date: Fri, 24 Nov 2023 20:03:05 -0500 Subject: [PATCH] some changes to form some changes to form --- csm_web/frontend/src/components/UserProfile.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/csm_web/frontend/src/components/UserProfile.tsx b/csm_web/frontend/src/components/UserProfile.tsx index 52a26f24..88b0a90a 100644 --- a/csm_web/frontend/src/components/UserProfile.tsx +++ b/csm_web/frontend/src/components/UserProfile.tsx @@ -62,7 +62,7 @@ const DisplayUser = ({ userInfo }: UserInfoProps) => { /** * User Bio */ - const [userBio, setUserBio] = useState(""); + const [bio, setBio] = useState(""); const handleEditing = () => { setEditing(true); @@ -82,7 +82,7 @@ const DisplayUser = ({ userInfo }: UserInfoProps) => { userFirstName, userLastName, userEmail, - userBio, + bio, userPronoun }; @@ -111,7 +111,7 @@ const DisplayUser = ({ userInfo }: UserInfoProps) => { setUserPronoun(value); break; case "bio": - setUserBio(value); + setBio(value); break; default: console.error("Unknown input name: " + name); @@ -160,7 +160,7 @@ const DisplayUser = ({ userInfo }: UserInfoProps) => { id="email" defaultValue={userInfo.email} className="formbold-form-input" - disabled={!editing} + disabled={true} onChange={e => handleChange("email", e.target.value)} /> @@ -172,6 +172,7 @@ const DisplayUser = ({ userInfo }: UserInfoProps) => { id="pronouns" placeholder="" className="formbold-form-input" + defaultValue={userInfo.pronouns} disabled={!editing} onChange={e => handleChange("pronouns", e.target.value)} /> @@ -186,6 +187,7 @@ const DisplayUser = ({ userInfo }: UserInfoProps) => { placeholder="Write your bio..." className="formbold-form-input" disabled={!editing} + defaultValue={userInfo.bio} onChange={e => handleChange("bio", e.target.value)} >