From 563063ba179783186ae66441d9dafd1943e20b94 Mon Sep 17 00:00:00 2001 From: Olivier Date: Fri, 3 Jul 2026 18:31:59 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20la=20possibilit=C3=A9=20de=20voir?= =?UTF-8?q?=20le=20mot=20de=20passe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/PasswordInput.jsx | 48 +++++++++++++++++++++++ frontend/src/pages/InvitationRegister.jsx | 5 ++- frontend/src/pages/Login.jsx | 3 +- frontend/src/pages/MonCompte.jsx | 11 +++--- frontend/src/pages/Register.jsx | 5 ++- frontend/src/pages/ResetPassword.jsx | 9 +++-- frontend/src/pages/admin/UsersSection.jsx | 3 +- 7 files changed, 69 insertions(+), 15 deletions(-) create mode 100644 frontend/src/components/PasswordInput.jsx diff --git a/frontend/src/components/PasswordInput.jsx b/frontend/src/components/PasswordInput.jsx new file mode 100644 index 0000000..0cc04d7 --- /dev/null +++ b/frontend/src/components/PasswordInput.jsx @@ -0,0 +1,48 @@ +import { useState } from 'react'; + +/** + * Champ mot de passe avec bouton "afficher/masquer". + * Utilisation : remplacer par + * Toutes les props (className, value, onChange, required, autoComplete, style, etc.) + * sont transmises telles quelles à l' sous-jacent. + */ +function EyeIcon({ open }) { + return open ? ( + + + + + ) : ( + + + + + ); +} + +export default function PasswordInput({ style, wrapperStyle, ...props }) { + const [show, setShow] = useState(false); + + return ( +
+ + +
+ ); +} diff --git a/frontend/src/pages/InvitationRegister.jsx b/frontend/src/pages/InvitationRegister.jsx index 6a4ef42..9d215ca 100644 --- a/frontend/src/pages/InvitationRegister.jsx +++ b/frontend/src/pages/InvitationRegister.jsx @@ -1,5 +1,6 @@ import { useState, useEffect } from 'react'; import PasswordStrength from '../components/PasswordStrength.jsx'; +import PasswordInput from '../components/PasswordInput.jsx'; import { useParams, useNavigate, Link } from 'react-router-dom'; // Wrap défini en dehors du composant pour éviter le remontage à chaque frappe @@ -173,13 +174,13 @@ export default function InvitationRegister() {
- set('password', e.target.value)} style={{ width: '100%' }} /> + set('password', e.target.value)} style={{ width: '100%' }} />
- set('confirm', e.target.value)} style={{ width: '100%' }} /> + set('confirm', e.target.value)} style={{ width: '100%' }} />