From dff86aa6e94dc3f05c76887b67a5503ffd226494 Mon Sep 17 00:00:00 2001 From: MathieuSevignyLavallee <89943988+MathieuSevignyLavallee@users.noreply.github.com> Date: Thu, 17 Oct 2024 21:34:47 -0400 Subject: [PATCH] remove old files teacher/login teacher/register teacher/resetPassword --- client/src/pages/Teacher/Login/Login.css | 17 ---- client/src/pages/Teacher/Login/Login.tsx | 94 ------------------- .../src/pages/Teacher/Register/Register.tsx | 81 ---------------- .../Teacher/ResetPassword/ResetPassword.tsx | 68 -------------- 4 files changed, 260 deletions(-) delete mode 100644 client/src/pages/Teacher/Login/Login.css delete mode 100644 client/src/pages/Teacher/Login/Login.tsx delete mode 100644 client/src/pages/Teacher/Register/Register.tsx delete mode 100644 client/src/pages/Teacher/ResetPassword/ResetPassword.tsx diff --git a/client/src/pages/Teacher/Login/Login.css b/client/src/pages/Teacher/Login/Login.css deleted file mode 100644 index ddbebdb..0000000 --- a/client/src/pages/Teacher/Login/Login.css +++ /dev/null @@ -1,17 +0,0 @@ -.login-links { - padding-top: 10px; - width: 100%; - display: flex; - flex-direction: column; - align-items: center; -} - -.login-links a { - padding: 4px; - color: #333; - text-decoration: none; -} - -.login-links a:hover { - text-decoration: underline; -} diff --git a/client/src/pages/Teacher/Login/Login.tsx b/client/src/pages/Teacher/Login/Login.tsx deleted file mode 100644 index d688dbd..0000000 --- a/client/src/pages/Teacher/Login/Login.tsx +++ /dev/null @@ -1,94 +0,0 @@ -import { useNavigate, Link } from 'react-router-dom'; - -// JoinRoom.tsx -import React, { useEffect, useState } from 'react'; - -import './Login.css'; -import { TextField } from '@mui/material'; -import LoadingButton from '@mui/lab/LoadingButton'; - -import LoginContainer from '../../../components/LoginContainer/LoginContainer' -import ApiService from '../../../services/ApiService'; - -const Login: React.FC = () => { - const navigate = useNavigate(); - - const [email, setEmail] = useState(''); - const [password, setPassword] = useState(''); - - const [connectionError, setConnectionError] = useState(''); - const [isConnecting] = useState(false); - - useEffect(() => { - return () => { - - }; - }, []); - - const login = async () => { - const result = await ApiService.login(email, password); - - if (result != true) { - setConnectionError(result); - return; - } - else { - navigate("/teacher/Dashboard") - } - - }; - - - return ( - - - setEmail(e.target.value)} - placeholder="Nom d'utilisateur" - sx={{ marginBottom: '1rem' }} - fullWidth - /> - - setPassword(e.target.value)} - placeholder="Nom de la salle" - sx={{ marginBottom: '1rem' }} - fullWidth - /> - - - Login - - -
- - - Réinitialiser le mot de passe - - - - Créer un compte - - -
- -
- ); -}; - -export default Login; diff --git a/client/src/pages/Teacher/Register/Register.tsx b/client/src/pages/Teacher/Register/Register.tsx deleted file mode 100644 index 2dd1f3c..0000000 --- a/client/src/pages/Teacher/Register/Register.tsx +++ /dev/null @@ -1,81 +0,0 @@ - -import { useNavigate } from 'react-router-dom'; - -// JoinRoom.tsx -import React, { useEffect, useState } from 'react'; - -import { TextField } from '@mui/material'; -import LoadingButton from '@mui/lab/LoadingButton'; - -import LoginContainer from '../../../components/LoginContainer/LoginContainer' -import ApiService from '../../../services/ApiService'; - -const Register: React.FC = () => { - const navigate = useNavigate(); - - const [email, setEmail] = useState(''); - const [password, setPassword] = useState(''); - - const [connectionError, setConnectionError] = useState(''); - const [isConnecting] = useState(false); - - useEffect(() => { - return () => { - - }; - }, []); - - const register = async () => { - const result = await ApiService.register(email, password, "temp"); // "temp", car ce fichier n'est plus utilisé. il est déplacer dans /AuthManager - - if (result != true) { - setConnectionError(result); - return; - } - - navigate("/teacher/login") - }; - - - return ( - - - setEmail(e.target.value)} - placeholder="Adresse courriel" - sx={{ marginBottom: '1rem' }} - fullWidth - /> - - setPassword(e.target.value)} - placeholder="Mot de passe" - sx={{ marginBottom: '1rem' }} - fullWidth - /> - - - S'inscrire - - - - - ); -}; - -export default Register; diff --git a/client/src/pages/Teacher/ResetPassword/ResetPassword.tsx b/client/src/pages/Teacher/ResetPassword/ResetPassword.tsx deleted file mode 100644 index 4901de1..0000000 --- a/client/src/pages/Teacher/ResetPassword/ResetPassword.tsx +++ /dev/null @@ -1,68 +0,0 @@ - -import { useNavigate } from 'react-router-dom'; - -// JoinRoom.tsx -import React, { useEffect, useState } from 'react'; - -import { TextField } from '@mui/material'; -import LoadingButton from '@mui/lab/LoadingButton'; - -import LoginContainer from '../../../components/LoginContainer/LoginContainer' -import ApiService from '../../../services/ApiService'; - -const ResetPassword: React.FC = () => { - const navigate = useNavigate(); - - const [email, setEmail] = useState(''); - - const [connectionError, setConnectionError] = useState(''); - const [isConnecting] = useState(false); - - useEffect(() => { - return () => { - - }; - }, []); - - const reset = async () => { - const result = await ApiService.resetPassword(email); - - if (result != true) { - setConnectionError(result); - return; - } - - navigate("/teacher/login") - }; - - - return ( - - - setEmail(e.target.value)} - placeholder="Adresse courriel" - sx={{ marginBottom: '1rem' }} - fullWidth - /> - - - Réinitialiser le mot de passe - - - - ); -}; - -export default ResetPassword;