enter login & navigate all menu

This commit is contained in:
Raja Oktafrianto
2025-03-19 13:04:16 +07:00
parent 621cae6694
commit 16029e10cd
19 changed files with 348 additions and 131 deletions

View File

@ -69,6 +69,12 @@ const Login = () => {
setShowPassword(!showPassword);
};
const handleKeyPress = (e: { key: string }) => {
if (e.key === 'Enter') {
formik.handleSubmit();
}
};
return (
<div className="card max-w-[390px] w-full">
<form
@ -90,6 +96,7 @@ const Login = () => {
className={clsx('form-control', {
'is-invalid': formik.touched.username && formik.errors.username
})}
onKeyPress={handleKeyPress}
/>
</label>
{formik.touched.username && formik.errors.username && (
@ -112,6 +119,7 @@ const Login = () => {
className={clsx('form-control', {
'is-invalid': formik.touched.password && formik.errors.password
})}
onKeyPress={handleKeyPress}
/>
<button className="btn btn-icon" onClick={togglePassword}>
<KeenIcon icon="eye" className={clsx('text-gray-500', { hidden: showPassword })} />