From 34cc54f8a7b64eb5d2252fa219b018ef994689ab Mon Sep 17 00:00:00 2001 From: Pattadon Date: Tue, 28 Nov 2023 10:45:57 +0700 Subject: [PATCH] Update profile page with first name and about me fields --- frontend/src/components/profile/profilePage.jsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/profile/profilePage.jsx b/frontend/src/components/profile/profilePage.jsx index 31284e3..b48912a 100644 --- a/frontend/src/components/profile/profilePage.jsx +++ b/frontend/src/components/profile/profilePage.jsx @@ -5,14 +5,18 @@ import { useEffect, useState } from "react"; export function ProfileUpdatePage() { const [profile_pic, setProfilePic] = useState(undefined); const [about, setAbout] = useState(); + const [firstName, setFirstname] = useState(); useEffect(() => { const fetchUser = async () => { try { const response = await axiosInstance.get("/user/data/"); const fetchedProfilePic = response.data.profile_pic; const fetchedAbout = response.data.about; + console.log(fetchedAbout); + const fetchedFirstname = response.data.first_name; setProfilePic(fetchedProfilePic); setAbout(fetchedAbout); + setFirstname(fetchedFirstname); } catch (error) { console.error("Error fetching user:", error); } @@ -24,7 +28,7 @@ export function ProfileUpdatePage() {
Firstname
-
Sirin
+
{firstName}
{/*
User ID
*/}
@@ -57,7 +61,7 @@ export function ProfileUpdatePage() { max="100" >
*/} -{/* + {/*
Level
@@ -118,14 +122,11 @@ export function ProfileUpdatePage() { - + placeholder="Enter your about me" + value={about} + >
- {/*