After adding view icon for passwords
This commit is contained in:
parent
ad66af8e01
commit
55ddbb1c09
@ -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
|
||||
|
||||
@ -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<string | null>(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: (
|
||||
<InputAdornment position="end">
|
||||
<IconButton
|
||||
aria-label={showPassword ? t('common.hidePassword') : t('common.showPassword')}
|
||||
onClick={() => setShowPassword((v) => !v)}
|
||||
edge="end"
|
||||
size="small"
|
||||
>
|
||||
{showPassword ? <VisibilityOffRoundedIcon /> : <VisibilityRoundedIcon />}
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
),
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<TextField
|
||||
label={t('auth.totpOptional')}
|
||||
|
||||
@ -7,11 +7,15 @@ import {
|
||||
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 { useEffect, useState } from 'react';
|
||||
import { Link as RouterLink, Navigate, useNavigate, useSearchParams } from 'react-router-dom';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
@ -44,6 +48,8 @@ export function RegisterPage() {
|
||||
const [phone, setPhone] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const [confirmPassword, setConfirmPassword] = useState('');
|
||||
const [showPassword, setShowPassword] = useState(false);
|
||||
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
|
||||
const [country, setCountry] = useState('');
|
||||
const [nationality, setNationality] = useState('');
|
||||
const [gender, setGender] = useState<UserGender | ''>('');
|
||||
@ -231,15 +237,31 @@ export function RegisterPage() {
|
||||
/>
|
||||
<TextField
|
||||
label={t('auth.passwordRequired')}
|
||||
type="password"
|
||||
type={showPassword ? 'text' : 'password'}
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
fullWidth
|
||||
autoComplete="new-password"
|
||||
slotProps={{
|
||||
input: {
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<IconButton
|
||||
aria-label={showPassword ? t('common.hidePassword') : t('common.showPassword')}
|
||||
onClick={() => setShowPassword((v) => !v)}
|
||||
edge="end"
|
||||
size="small"
|
||||
>
|
||||
{showPassword ? <VisibilityOffRoundedIcon /> : <VisibilityRoundedIcon />}
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
),
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<TextField
|
||||
label={t('auth.confirmPasswordRequired')}
|
||||
type="password"
|
||||
type={showConfirmPassword ? 'text' : 'password'}
|
||||
value={confirmPassword}
|
||||
onChange={(e) => setConfirmPassword(e.target.value)}
|
||||
fullWidth
|
||||
@ -250,6 +272,28 @@ export function RegisterPage() {
|
||||
? t('auth.passwordsMustMatch')
|
||||
: undefined
|
||||
}
|
||||
slotProps={{
|
||||
input: {
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<IconButton
|
||||
aria-label={
|
||||
showConfirmPassword ? t('common.hidePassword') : t('common.showPassword')
|
||||
}
|
||||
onClick={() => setShowConfirmPassword((v) => !v)}
|
||||
edge="end"
|
||||
size="small"
|
||||
>
|
||||
{showConfirmPassword ? (
|
||||
<VisibilityOffRoundedIcon />
|
||||
) : (
|
||||
<VisibilityRoundedIcon />
|
||||
)}
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
),
|
||||
},
|
||||
}}
|
||||
/>
|
||||
|
||||
<CountryAutocomplete
|
||||
|
||||
@ -18,6 +18,8 @@ export const en = {
|
||||
edit: 'Edit',
|
||||
email: 'Email',
|
||||
password: 'Password',
|
||||
showPassword: 'Show password',
|
||||
hidePassword: 'Hide password',
|
||||
sending: 'Sending…',
|
||||
save: 'Save',
|
||||
cancel: 'Cancel',
|
||||
|
||||
@ -18,6 +18,8 @@ export const fr = {
|
||||
edit: 'Modifier',
|
||||
email: 'E-mail',
|
||||
password: 'Mot de passe',
|
||||
showPassword: 'Afficher le mot de passe',
|
||||
hidePassword: 'Masquer le mot de passe',
|
||||
sending: 'Envoi…',
|
||||
save: 'Enregistrer',
|
||||
cancel: 'Annuler',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user