create manageMember btn
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||||
|
<svg width="800px" height="800px" viewBox="0 -8 72 72" id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg"><defs><style>.cls-1{fill:#010002;}</style></defs><title>tools</title><path class="cls-1" d="M13.32,44.31a4.5,4.5,0,0,0,6.36,6.36L34.44,35.91l-6.36-6.36Z"/><polygon class="cls-1" points="50.2 16.96 56.63 13.63 60 7.13 56.86 3.99 50.36 7.36 47.03 13.78 39.21 21.61 42.38 24.79 50.2 16.96"/><path class="cls-1" d="M51.61,34,51,34a8.9,8.9,0,0,0-3.11.58L29.45,16.09A8.9,8.9,0,0,0,30,13l-.06-.6A8.9,8.9,0,0,0,17.19,4.89l6,6a3,3,0,0,1,.68,1.08A3,3,0,0,1,21,16a2.92,2.92,0,0,1-1-.21,3.15,3.15,0,0,1-1.08-.67l-6-6a8.9,8.9,0,0,0,7.49,12.78L21,22a8.9,8.9,0,0,0,3.11-.58L42.6,39.84A8.9,8.9,0,0,0,42,43l.06.6A9,9,0,0,0,51,51.94a8.72,8.72,0,0,0,3.85-.9l-6-6A3.08,3.08,0,0,1,48.21,44,3,3,0,0,1,51,40a2.92,2.92,0,0,1,1,.21,2.72,2.72,0,0,1,1.08.67l6,6A8.9,8.9,0,0,0,51.61,34Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 1009 B |
@@ -0,0 +1,21 @@
|
|||||||
|
import Button from "../ui/button/button.jsx";
|
||||||
|
import Modal from "../ui/modal/modal.jsx";
|
||||||
|
import { useState } from "react";
|
||||||
|
import styles from "./manageMember.module.css"
|
||||||
|
|
||||||
|
|
||||||
|
export default function ManageMember({ user }) {
|
||||||
|
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
|
||||||
|
return <>
|
||||||
|
<Button onClick={() => setOpen(true)} variant={"default"} className={styles.manageBtn}>
|
||||||
|
<img src="/icons/tools.svg" alt="tools icon" className={styles.icon} />
|
||||||
|
<p>Gérer</p>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Modal open={open} onClose={() => setOpen(false)} title={`Gestion de l'utilisateur ${user.name}`}>
|
||||||
|
|
||||||
|
</Modal>
|
||||||
|
</>
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
.icon {
|
||||||
|
width: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manageBtn {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
import styles from "./VolunteerProfilePage.module.css"
|
import styles from "./VolunteerProfilePage.module.css"
|
||||||
import { useParams } from "react-router";
|
import { useParams } from "react-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState, useContext } from "react";
|
||||||
import getUserById from "../../utils/users/getUserById.js";
|
import getUserById from "../../utils/users/getUserById.js";
|
||||||
import formatDate from "../../utils/date/formatDate.js";
|
import formatDate from "../../utils/date/formatDate.js";
|
||||||
import Task from "../../components/Task/Task.jsx";
|
import Task from "../../components/Task/Task.jsx";
|
||||||
import { useNavigate } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
|
import ManageMember from "../../components/manageMember/ManageMember.jsx";
|
||||||
|
import { AuthContext } from "../../contexts/auth/AuthContext.js";
|
||||||
|
|
||||||
export default function VolunteerProfilePage() {
|
export default function VolunteerProfilePage() {
|
||||||
|
|
||||||
@@ -13,6 +15,8 @@ export default function VolunteerProfilePage() {
|
|||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const { user: currentUser } = useContext(AuthContext);
|
||||||
|
|
||||||
const [user, setUser] = useState({});
|
const [user, setUser] = useState({});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -41,6 +45,7 @@ export default function VolunteerProfilePage() {
|
|||||||
<div className={styles.description}>
|
<div className={styles.description}>
|
||||||
<div className={styles.headerProfile}>
|
<div className={styles.headerProfile}>
|
||||||
<h2> {user.name} {user.lastname} </h2>
|
<h2> {user.name} {user.lastname} </h2>
|
||||||
|
{currentUser?.isAdmin && <ManageMember user={user} />}
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.topDescription}>
|
<div className={styles.topDescription}>
|
||||||
<div className={styles.infoBlock}>
|
<div className={styles.infoBlock}>
|
||||||
|
|||||||
Reference in New Issue
Block a user