Skip to content

Commit

Permalink
some changes to form
Browse files Browse the repository at this point in the history
some changes to form
  • Loading branch information
jacovkim committed Nov 25, 2023
1 parent d27c010 commit 1ba445c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions csm_web/frontend/src/components/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const DisplayUser = ({ userInfo }: UserInfoProps) => {
/**
* User Bio
*/
const [userBio, setUserBio] = useState<string>("");
const [bio, setBio] = useState<string>("");

const handleEditing = () => {
setEditing(true);
Expand All @@ -82,7 +82,7 @@ const DisplayUser = ({ userInfo }: UserInfoProps) => {
userFirstName,
userLastName,
userEmail,
userBio,
bio,
userPronoun
};

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)}
/>
<label className="formbold-form-label"> Email </label>
Expand All @@ -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)}
/>
Expand All @@ -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)}
></textarea>
<label className="formbold-form-label"> Bio </label>
Expand Down

0 comments on commit 1ba445c

Please sign in to comment.