From 73588ae9a82faff816ed4ef9c953edf159f82a72 Mon Sep 17 00:00:00 2001 From: Maxence Lanone Date: Fri, 21 Oct 2022 14:05:59 +0200 Subject: [PATCH] correction page admin (chargement lors du clic) --- src/components/NavigationAdmin.js | 6 +++--- src/pages/Admin.js | 16 ---------------- src/pages/Connexion.js | 4 +++- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/components/NavigationAdmin.js b/src/components/NavigationAdmin.js index 419cf36..d50a6cc 100644 --- a/src/components/NavigationAdmin.js +++ b/src/components/NavigationAdmin.js @@ -7,13 +7,13 @@ const NavigationAdmin = () => {
- + - + - +
diff --git a/src/pages/Admin.js b/src/pages/Admin.js index 33cc982..376d24f 100644 --- a/src/pages/Admin.js +++ b/src/pages/Admin.js @@ -40,20 +40,4 @@ const Admin = () => { ); }; -function Create_user() { - document.getElementById("user").onclick = function() {Create_user()}; - document.location.href = "http://localhost:3000/"; -} - -function Modify_user(){ - document.getElementById("user").onclick = function() {Modify_user()}; - document.location.href = "http://localhost:3000/"; -} - -/*function Delete_user(){ - //document.getElementById("user").onclick = function() {Delete_user()}; - document.location = './pages/Admin_supp'; - console.log(document.location); -}*/ - export default Admin; \ No newline at end of file diff --git a/src/pages/Connexion.js b/src/pages/Connexion.js index e97ba90..67384f5 100644 --- a/src/pages/Connexion.js +++ b/src/pages/Connexion.js @@ -1,6 +1,8 @@ import axios from 'axios' import React, { useState } from 'react'; import CryptoJS from 'crypto-js'; +import { NavLink } from 'react-router-dom'; +import Admin from './Admin.js' const api = axios.create({ baseURL: 'http://localhost:8080' @@ -52,7 +54,7 @@ function Connexion() { if (auth === "Succeed") { return( -
My CRM
+ ); } else {