Add logout btn
This commit is contained in:
@@ -8,9 +8,13 @@ import { useNavigate } from "react-router";
|
||||
|
||||
function ProfilePage() {
|
||||
|
||||
const { user } = useContext(AuthContext);
|
||||
const { user, logout } = useContext(AuthContext);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleLogout = () => {
|
||||
logout();
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<div className={`${styles.profileboard} glassCard`}>
|
||||
@@ -23,7 +27,10 @@ function ProfilePage() {
|
||||
/>
|
||||
</div>
|
||||
<div className={styles.description}>
|
||||
<h2> {user.name} {user.lastname} </h2>
|
||||
<div className={styles.headerProfile}>
|
||||
<h2> {user.name} {user.lastname} </h2>
|
||||
<Button variant={"danger"} onClick={handleLogout}> Déconnexion </Button>
|
||||
</div>
|
||||
<div className={styles.topDescription}>
|
||||
<div className={styles.infoBlock}>
|
||||
<p><strong>Role :</strong> {user.role}</p>
|
||||
|
||||
Reference in New Issue
Block a user