diff --git a/src/pages/Profile/ProfilePage.module.css b/src/pages/Profile/ProfilePage.module.css index a47a7a7..288c0d1 100644 --- a/src/pages/Profile/ProfilePage.module.css +++ b/src/pages/Profile/ProfilePage.module.css @@ -133,6 +133,29 @@ margin-top: 16px; } +.profilePictureContainer { + position: relative; +} + +.pictureOverlay { + position: absolute; + bottom: 0; + left: 0; + right: 0; + background: rgba(0, 0, 0, 0.5); + color: white; + text-align: center; + padding: 2px; + border-radius: 0 0 90% 90%; + opacity: 0; + transition: opacity 0.2s; +} +.clickable { + cursor: pointer; +} +.profilePictureContainer:hover .pictureOverlay { + opacity: 1; +} @media (min-width: 768px) { .contentWrapper { flex-direction: row; @@ -172,7 +195,6 @@ } } -/* Adaptation pour grand écran */ @media (min-width: 1024px) { .container { max-width: 1200px; diff --git a/src/pages/Profile/ProfilePage.tsx b/src/pages/Profile/ProfilePage.tsx index 897ff61..12a2e34 100644 --- a/src/pages/Profile/ProfilePage.tsx +++ b/src/pages/Profile/ProfilePage.tsx @@ -1,7 +1,6 @@ -import getXSRFToken from "../../utils/getXSRF.js"; import {useContext, useEffect, useState} from "react"; import styles from "./ProfilePage.module.css"; -import {AuthContext} from "../../../src/contexts/Auth/AuthContext.js"; +import {AuthContext} from "../../contexts/Auth/AuthContext"; import formatDate from "../../utils/date/formatDate"; import Task from "../../components/Task/Task"; import SettingsModal from "./components/SettingsModal/SettingsModal"; @@ -63,7 +62,7 @@ function ProfilePage() { (async () => { console.log(JSON.stringify(import.meta.env.VITE_API_URL)); if (!isOwnProfile && id) { - const res = await getUserById(id); + const res = await getUserById(Number(id)); if (res.status === 404) { navigate("/404"); return; @@ -107,7 +106,7 @@ function ProfilePage() { }; const handleDeletePicture = async () => { - deleteProfilePhoto(); + await deleteProfilePhoto(); setProfilePicture(null); }; @@ -115,27 +114,27 @@ function ProfilePage() {