mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-04-23 19:37:52 +00:00
Updated PasswordField Icons and made it accessible
This commit is contained in:
parent
373370f80e
commit
431c1fe9b3
@ -1,4 +1,4 @@
|
|||||||
import { InputAdornment, TextField, TextFieldProps, styled } from "@mui/material";
|
import { Button, InputAdornment, TextField, TextFieldProps, styled } from "@mui/material";
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
|
||||||
export const CustomInput = styled(TextField)({
|
export const CustomInput = styled(TextField)({
|
||||||
@ -48,12 +48,10 @@ export const PasswordField: React.FunctionComponent<TextFieldProps> = ({ ...prop
|
|||||||
type={canViewPassword ? 'text' : 'password'}
|
type={canViewPassword ? 'text' : 'password'}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
endAdornment: (
|
endAdornment: (
|
||||||
<InputAdornment position="end" data-testid="toggle-view-password-btn" style={{
|
<InputAdornment position="end" data-testid="toggle-view-password-btn" onClick={() => {
|
||||||
cursor: 'pointer'
|
|
||||||
}} onClick={() => {
|
|
||||||
setCanViewPassword((prevState) => !prevState)
|
setCanViewPassword((prevState) => !prevState)
|
||||||
}}>
|
}}>
|
||||||
{canViewPassword ? <span data-testid="plain-text-indicator">🙀</span> : <span data-testid="password-text-indicator">😸</span>}
|
{canViewPassword ? <Button data-testid="plain-text-indicator" sx={{ minWidth: 0, p: 0 }}>👁️</Button> : <Button data-testid="password-text-indicator" sx={{ minWidth: 0, p: 0 }}>👁️🗨️</Button>}
|
||||||
</InputAdornment>
|
</InputAdornment>
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user