From 55ddbb1c09d8667976c3910251755bb984eb3970 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 2 Nov 2026 19:24:28 +0200 Subject: [PATCH] After adding view icon for passwords --- prediqo_mobile/pubspec.yaml | 2 +- prediqo_web/src/features/auth/LoginPage.tsx | 35 +++++++++++++- .../src/features/auth/RegisterPage.tsx | 48 ++++++++++++++++++- prediqo_web/src/shared/i18n/locales/en.ts | 2 + prediqo_web/src/shared/i18n/locales/fr.ts | 2 + 5 files changed, 84 insertions(+), 5 deletions(-) diff --git a/prediqo_mobile/pubspec.yaml b/prediqo_mobile/pubspec.yaml index 664b85bc..8f5db6e6 100644 --- a/prediqo_mobile/pubspec.yaml +++ b/prediqo_mobile/pubspec.yaml @@ -1,7 +1,7 @@ name: prediqo_mobile description: "Tloto mobile app - prediction games and crypto wallet." publish_to: 'none' -version: 2.0.2+9 +version: 2.0.2+10 environment: sdk: ^3.9.2 diff --git a/prediqo_web/src/features/auth/LoginPage.tsx b/prediqo_web/src/features/auth/LoginPage.tsx index 43081e7e..c3214b3b 100644 --- a/prediqo_web/src/features/auth/LoginPage.tsx +++ b/prediqo_web/src/features/auth/LoginPage.tsx @@ -3,7 +3,21 @@ * Authenticates via `/api/v1/auth/login`, stores tokens in auth context, * and redirects to the route the user attempted before sign-in. */ -import { Alert, Box, Button, Card, CardContent, Link, Stack, TextField, Typography } from '@mui/material'; +import { + Alert, + Box, + Button, + Card, + CardContent, + IconButton, + InputAdornment, + Link, + Stack, + TextField, + Typography, +} from '@mui/material'; +import VisibilityOffRoundedIcon from '@mui/icons-material/VisibilityOffRounded'; +import VisibilityRoundedIcon from '@mui/icons-material/VisibilityRounded'; import { useState, useCallback } from 'react'; import { Navigate, useLocation, useNavigate, Link as RouterLink } from 'react-router-dom'; import { useQuery } from '@tanstack/react-query'; @@ -52,6 +66,7 @@ export function LoginPage() { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); + const [showPassword, setShowPassword] = useState(false); const [totpCode, setTotpCode] = useState(''); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); @@ -259,9 +274,25 @@ export function LoginPage() { label={t('common.password')} value={password} onChange={(e) => setPassword(e.target.value)} - type="password" + type={showPassword ? 'text' : 'password'} autoComplete="current-password" fullWidth + slotProps={{ + input: { + endAdornment: ( + + setShowPassword((v) => !v)} + edge="end" + size="small" + > + {showPassword ? : } + + + ), + }, + }} /> (''); @@ -231,15 +237,31 @@ export function RegisterPage() { /> setPassword(e.target.value)} fullWidth autoComplete="new-password" + slotProps={{ + input: { + endAdornment: ( + + setShowPassword((v) => !v)} + edge="end" + size="small" + > + {showPassword ? : } + + + ), + }, + }} /> setConfirmPassword(e.target.value)} fullWidth @@ -250,6 +272,28 @@ export function RegisterPage() { ? t('auth.passwordsMustMatch') : undefined } + slotProps={{ + input: { + endAdornment: ( + + setShowConfirmPassword((v) => !v)} + edge="end" + size="small" + > + {showConfirmPassword ? ( + + ) : ( + + )} + + + ), + }, + }} />