diff --git a/frontend-prep/src/pages/User/ProfilePage.css b/frontend-prep/src/pages/User/ProfilePage.css index 83413ae4..bacc8b64 100644 --- a/frontend-prep/src/pages/User/ProfilePage.css +++ b/frontend-prep/src/pages/User/ProfilePage.css @@ -179,6 +179,79 @@ font-weight: 500; } +/* Toggle 2FA */ +.profile-2fa-row { + display: flex; + align-items: center; + justify-content: space-between; + padding-top: 0.4rem; + gap: 1rem; +} + +.profile-2fa-label { + display: flex; + flex-direction: column; + gap: 0.25rem; + font-size: 0.9rem; + font-weight: 600; + color: var(--text); +} + +.profile-2fa-badge { + display: flex; + align-items: center; + gap: 0.3rem; + font-size: 0.78rem; + font-weight: 500; + color: #10b981; +} + +.profile-toggle { + position: relative; + width: 48px; + height: 26px; + border-radius: 13px; + border: none; + background: var(--border); + cursor: pointer; + padding: 0; + flex-shrink: 0; + transition: background 0.25s; +} + +.profile-toggle--on { + background: #6366f155; + border: 1px solid #6366f1; +} + +.profile-toggle-thumb { + position: absolute; + top: 3px; + left: 3px; + width: 20px; + height: 20px; + border-radius: 50%; + background: var(--text-muted); + transition: transform 0.25s, background 0.25s; +} + +.profile-toggle--on .profile-toggle-thumb { + transform: translateX(22px); + background: #6366f1; +} + +.profile-2fa-spinner { + width: 20px; + height: 20px; + border: 2px solid #6366f133; + border-top-color: #6366f1; + border-radius: 50%; + animation: spin 0.7s linear infinite; + flex-shrink: 0; +} + +@keyframes spin { to { transform: rotate(360deg); } } + @media (max-width: 480px) { .profile-row { grid-template-columns: 1fr; } } diff --git a/frontend-prep/src/pages/User/ProfilePage.tsx b/frontend-prep/src/pages/User/ProfilePage.tsx index 2e4710fb..5a4ca2fe 100644 --- a/frontend-prep/src/pages/User/ProfilePage.tsx +++ b/frontend-prep/src/pages/User/ProfilePage.tsx @@ -310,21 +310,29 @@ export default function ProfilePage() { Double authentification (2FA)

- À chaque connexion, un code vous sera envoyé sur Telegram avant d'accéder à votre compte. + À chaque connexion, un code à 6 chiffres vous sera envoyé sur Telegram avant d'accéder à votre compte.

-
- - {twoFAEnabled && ( - - Activée - +
+
+ {twoFAEnabled ? 'Activée' : 'Désactivée'} + {twoFAEnabled && ( + + Protection active + + )} +
+ {twoFALoading ? ( +
+ ) : ( + )}