From 293df20781b8f0ae6fcbabb1a33b3d1752e494c8 Mon Sep 17 00:00:00 2001 From: l3wdfut4pwr Date: Tue, 17 Mar 2026 21:51:22 +0200 Subject: add password toggle button --- public/icons/hide-icon.svg | 3 +++ public/icons/show-icon.svg | 3 +++ src/components/header/authdialog/LoginForm.tsx | 2 +- src/components/header/authdialog/RegisterForm.tsx | 2 ++ src/components/ui/input.tsx | 30 ++++++++++++++++++----- 5 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 public/icons/hide-icon.svg create mode 100644 public/icons/show-icon.svg diff --git a/public/icons/hide-icon.svg b/public/icons/hide-icon.svg new file mode 100644 index 0000000..e63d8c3 --- /dev/null +++ b/public/icons/hide-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/icons/show-icon.svg b/public/icons/show-icon.svg new file mode 100644 index 0000000..b977ba9 --- /dev/null +++ b/public/icons/show-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/header/authdialog/LoginForm.tsx b/src/components/header/authdialog/LoginForm.tsx index c5b606c..0a72f67 100644 --- a/src/components/header/authdialog/LoginForm.tsx +++ b/src/components/header/authdialog/LoginForm.tsx @@ -14,7 +14,7 @@ export default function LoginForm() {
- +
diff --git a/src/components/header/authdialog/RegisterForm.tsx b/src/components/header/authdialog/RegisterForm.tsx index 20a7c14..3c2c164 100644 --- a/src/components/header/authdialog/RegisterForm.tsx +++ b/src/components/header/authdialog/RegisterForm.tsx @@ -80,6 +80,7 @@ export default function RegisterForm() {
) { - return ; +export function Input({ className, isPassword, ...props }: any) { + const [show, setShow] = useState(false); + return ( +
+ + {isPassword && ( + setShow(!show)} + className="absolute right-0 top-1/2 -translate-y-1/2 cursor-pointer" + > + {show ? : } + + )} +
+ ); } -- cgit v1.3-3-g829e