fix showPasswordButton for login form
This commit is contained in:
@@ -15,17 +15,10 @@ export default function LoginForm() {
|
|||||||
|
|
||||||
const [showPassword, setShowPassword] = useState(false);
|
const [showPassword, setShowPassword] = useState(false);
|
||||||
|
|
||||||
function handleMouseDown() {
|
function showPassowrd() {
|
||||||
setShowPassword(true);
|
setShowPassword(!showPassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseUp() {
|
|
||||||
setShowPassword(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleMouseOut() {
|
|
||||||
setShowPassword(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
const checkBoxRememberMe = useRef<HTMLInputElement>(null);
|
const checkBoxRememberMe = useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
@@ -65,9 +58,9 @@ export default function LoginForm() {
|
|||||||
placeholder={t('enter-password')}
|
placeholder={t('enter-password')}
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
onMouseDown={handleMouseDown}
|
onClick={() => {
|
||||||
onMouseUp={handleMouseUp}
|
showPassowrd();
|
||||||
onMouseOut={handleMouseOut}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
className={`show-password-button ${showPassword ? 'show' : ''}`}
|
className={`show-password-button ${showPassword ? 'show' : ''}`}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user