diff --git a/src/pages/Admin_supp.js b/src/pages/Admin_supp.js
index c652765..6a1db1d 100644
--- a/src/pages/Admin_supp.js
+++ b/src/pages/Admin_supp.js
@@ -1,44 +1,52 @@
import React, { useState, useEffect } from 'react';
import axios from 'axios'
import NavigationAdmin from '../components/NavigationAdmin.js';
+import { NavLink, useLocation } from "react-router-dom";
import { TableContainer,Table,TableHead,TableBody,TableRow,TableCell } from '@mui/material';
import { Paper } from '@mui/material';
+import { useNavigate } from "react-router-dom";
const api = axios.create({
baseURL: 'http://localhost:8080'
})
-const Admin_supp = () => {
+function Admin_supp(){
- const [users, setUsers] = useState([]);
- const [selectedIdUser, setSelectedIdUser] = useState();
+ const location = useLocation();
+ const { iduser } = location.state;
+
+ const [selectedUser, setSelectedUsers] = useState([]);
+
+ const navigate = useNavigate();
useEffect(() =>{
- api.get('/User/All/').then((response) => {
- setUsers(response.data);
- setSelectedIdUser(response.data[0].iduser);
+ const apiString = '/User/Id/' + iduser;
+ api.get(apiString).then((response) => {
+ console.log(response.data[0]);
+ setSelectedUsers(response.data[0]);
});
}, []);
- const handleClick = (event, iduser) => {
- setSelectedIdUser(iduser);
- };
+ function checkDelete(event){
+
+ event.preventDefault();
+
+ const apiString = '/User/Delete/' + iduser;
+ api.delete(apiString).then((response) => {
+ console.log(response.data);
+ });
+
+ navigate("/Admin_list");
+ }
return (
- {/* Create a page to delete an user in the admin page*/}
Admin
Supression d'utilisateur
+
+
+ Retour
+
);
diff --git a/src/pages/Chargement.js b/src/pages/Chargement.js
new file mode 100644
index 0000000..b8556dc
--- /dev/null
+++ b/src/pages/Chargement.js
@@ -0,0 +1,16 @@
+import React from 'react';
+import ReactLoading from 'react-loading';
+
+
+
+const Chargement = () => {
+
+ return(
+
+
![]()
+
+
+ );
+}
+
+export default Chargement;
\ No newline at end of file
diff --git a/src/pages/Compte.js b/src/pages/Compte.js
index d69edc4..c9ac993 100644
--- a/src/pages/Compte.js
+++ b/src/pages/Compte.js
@@ -1,13 +1,18 @@
import { Component } from '@fullcalendar/core';
-import React, { useState } from 'react';
+import userEvent from '@testing-library/user-event';
+import React, { useEffect, useState } from 'react';
import NavigationDashboard from '../components/NavigationDashboard';
import img1 from '../img/logo_personEntouré.svg';
+import axios from 'axios'
-
+const api = axios.create({
+ baseURL: 'http://localhost:8080'
+ })
function Compte() {
- const [theme, setTheme] = useState("light");
+ const [theme, setTheme] = useState("light");
+ const [modification, setModification] = useState(false);
if (localStorage.getItem('theme') && localStorage.getItem("theme") !== '' && localStorage.getItem("theme") !== theme) {
setTheme(localStorage.getItem("theme"))
}
@@ -18,6 +23,11 @@ function Compte() {
setFile(URL.createObjectURL(e.target.files[0]));
}
+ const modificationHandler = () => {
+ setModification((modification) => !modification)
+ console.log(modification)
+ }
+
return (
@@ -58,10 +68,11 @@ function Compte() {
Nom Complet :
+
{}
Mateo Centeno
-
+
diff --git a/src/pages/Connexion.js b/src/pages/Connexion.js
index 343fdcd..8ce50c5 100644
--- a/src/pages/Connexion.js
+++ b/src/pages/Connexion.js
@@ -1,9 +1,10 @@
import axios from 'axios'
-import React, { useState } from 'react';
+import React, { useState, useEffect } from 'react';
import CryptoJS from 'crypto-js';
import Admin from './Admin_create.js'
import Dashboard from './Dashboard.js'
import Admin_list from './Admin_list.js';
+import Chargement from './Chargement.js';
const api = axios.create({
baseURL: 'http://localhost:8080'
@@ -58,6 +59,15 @@ function Connexion() {
});
}
+ const [loader, setLoader] = useState(true);
+
+ useEffect(() => {
+ setTimeout(() => {
+ setLoader(false);
+ }, 3000)
+ }, [])
+
+
if (auth === "Succeed") {
const apiString = '/User/role/' + login;
api.get(apiString).then((response) => {
@@ -77,7 +87,9 @@ function Connexion() {
return (