mirror of
https://github.com/TurTaskProject/TurTaskWeb.git
synced 2025-12-18 21:44:07 +01:00
Update profile page with first name and about me
fields
This commit is contained in:
parent
22e2521413
commit
34cc54f8a7
@ -5,14 +5,18 @@ import { useEffect, useState } from "react";
|
|||||||
export function ProfileUpdatePage() {
|
export function ProfileUpdatePage() {
|
||||||
const [profile_pic, setProfilePic] = useState(undefined);
|
const [profile_pic, setProfilePic] = useState(undefined);
|
||||||
const [about, setAbout] = useState();
|
const [about, setAbout] = useState();
|
||||||
|
const [firstName, setFirstname] = useState();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchUser = async () => {
|
const fetchUser = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await axiosInstance.get("/user/data/");
|
const response = await axiosInstance.get("/user/data/");
|
||||||
const fetchedProfilePic = response.data.profile_pic;
|
const fetchedProfilePic = response.data.profile_pic;
|
||||||
const fetchedAbout = response.data.about;
|
const fetchedAbout = response.data.about;
|
||||||
|
console.log(fetchedAbout);
|
||||||
|
const fetchedFirstname = response.data.first_name;
|
||||||
setProfilePic(fetchedProfilePic);
|
setProfilePic(fetchedProfilePic);
|
||||||
setAbout(fetchedAbout);
|
setAbout(fetchedAbout);
|
||||||
|
setFirstname(fetchedFirstname);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error fetching user:", error);
|
console.error("Error fetching user:", error);
|
||||||
}
|
}
|
||||||
@ -24,7 +28,7 @@ export function ProfileUpdatePage() {
|
|||||||
<div className="stats shadow mt-3">
|
<div className="stats shadow mt-3">
|
||||||
<div className="stat">
|
<div className="stat">
|
||||||
<div className="stat-title truncate">Firstname</div>
|
<div className="stat-title truncate">Firstname</div>
|
||||||
<div className="stat-value truncate">Sirin</div>
|
<div className="stat-value truncate">{firstName}</div>
|
||||||
{/* <div className="stat-desc truncate">User ID</div> */}
|
{/* <div className="stat-desc truncate">User ID</div> */}
|
||||||
<div className="stat-figure text-secondary">
|
<div className="stat-figure text-secondary">
|
||||||
<div className="avatar online">
|
<div className="avatar online">
|
||||||
@ -57,7 +61,7 @@ export function ProfileUpdatePage() {
|
|||||||
max="100"
|
max="100"
|
||||||
></progress>
|
></progress>
|
||||||
</div> */}
|
</div> */}
|
||||||
{/*
|
{/*
|
||||||
<div className="stat">
|
<div className="stat">
|
||||||
<div className="stat-title truncate">Level</div>
|
<div className="stat-title truncate">Level</div>
|
||||||
<div className="stat-value flex">
|
<div className="stat-value flex">
|
||||||
@ -118,14 +122,11 @@ export function ProfileUpdatePage() {
|
|||||||
<textarea
|
<textarea
|
||||||
className="textarea textarea-bordered textarea-lg w-full"
|
className="textarea textarea-bordered textarea-lg w-full"
|
||||||
disabled
|
disabled
|
||||||
placeholder="Enter your about me"
|
placeholder="Enter your about me"
|
||||||
>
|
value={about}
|
||||||
{about}
|
></textarea>
|
||||||
</textarea>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* <div className="grid grid-cols-2 grid-rows-2 gap-4 my-2">
|
{/* <div className="grid grid-cols-2 grid-rows-2 gap-4 my-2">
|
||||||
<div className="col-span-full">
|
<div className="col-span-full">
|
||||||
<div className="card bg-base-100 shadow">
|
<div className="card bg-base-100 shadow">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user