@@ -5,14 +5,18 @@ import { useEffect, useState } from "react";
55export function ProfileUpdatePage ( ) {
66 const [ profile_pic , setProfilePic ] = useState ( undefined ) ;
77 const [ about , setAbout ] = useState ( ) ;
8+ const [ firstName , setFirstname ] = useState ( ) ;
89 useEffect ( ( ) => {
910 const fetchUser = async ( ) => {
1011 try {
1112 const response = await axiosInstance . get ( "/user/data/" ) ;
1213 const fetchedProfilePic = response . data . profile_pic ;
1314 const fetchedAbout = response . data . about ;
15+ console . log ( fetchedAbout ) ;
16+ const fetchedFirstname = response . data . first_name ;
1417 setProfilePic ( fetchedProfilePic ) ;
1518 setAbout ( fetchedAbout ) ;
19+ setFirstname ( fetchedFirstname ) ;
1620 } catch ( error ) {
1721 console . error ( "Error fetching user:" , error ) ;
1822 }
@@ -24,7 +28,7 @@ export function ProfileUpdatePage() {
2428 < div className = "stats shadow mt-3" >
2529 < div className = "stat" >
2630 < div className = "stat-title truncate" > Firstname</ div >
27- < div className = "stat-value truncate" > Sirin </ div >
31+ < div className = "stat-value truncate" > { firstName } </ div >
2832 { /* <div className="stat-desc truncate">User ID</div> */ }
2933 < div className = "stat-figure text-secondary" >
3034 < div className = "avatar online" >
@@ -57,7 +61,7 @@ export function ProfileUpdatePage() {
5761 max="100"
5862 ></progress>
5963 </div> */ }
60- { /*
64+ { /*
6165 <div className="stat">
6266 <div className="stat-title truncate">Level</div>
6367 <div className="stat-value flex">
@@ -118,14 +122,11 @@ export function ProfileUpdatePage() {
118122 < textarea
119123 className = "textarea textarea-bordered textarea-lg w-full"
120124 disabled
121- placeholder = "Enter your about me"
122- >
123- { about }
124- </ textarea >
125-
125+ placeholder = "Enter your about me"
126+ value = { about }
127+ > </ textarea >
126128 </ div >
127129 </ div >
128-
129130 { /* <div className="grid grid-cols-2 grid-rows-2 gap-4 my-2">
130131 <div className="col-span-full">
131132 <div className="card bg-base-100 shadow">
0 commit comments