From 5544fa8b88e9c4a925f9119197e6be1e04887508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D1=82=D0=B0=D0=BB=D0=B8=D0=B9=20=D0=9B=D0=B0?= =?UTF-8?q?=D0=B2=D1=88=D0=BE=D0=BD=D0=BE=D0=BA?= <114582703+valavshonok@users.noreply.github.com> Date: Sun, 26 Oct 2025 07:39:41 +0300 Subject: [PATCH] autocomplete --- src/components/input/Input.tsx | 6 ++++++ src/views/home/auth/Login.tsx | 4 ++-- src/views/home/auth/Register.tsx | 8 ++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/input/Input.tsx b/src/components/input/Input.tsx index 8c01193..114a5f0 100644 --- a/src/components/input/Input.tsx +++ b/src/components/input/Input.tsx @@ -3,6 +3,7 @@ import { cn } from "../../lib/cn"; import { eyeClosed, eyeOpen } from "../../assets/icons/input"; interface inputProps { + name?: string; type: "text" | "email" | "password" | "first_name"; error?: string; disabled?: boolean; @@ -12,6 +13,7 @@ interface inputProps { className?: string; onChange: (state: string) => void; defaultState?: string; + autocomplete?: string; } export const Input: React.FC = ({ @@ -24,6 +26,8 @@ export const Input: React.FC = ({ className = "", onChange, defaultState = "", + name = "", + autocomplete="", }) => { const [value, setValue] = React.useState(defaultState); const [visible, setVIsible] = React.useState(type != "password"); @@ -47,6 +51,8 @@ export const Input: React.FC = ({ "bg-liquid-lighter w-full rounded-[10px] outline-none pl-[16px] py-[8px] placeholder:text-liquid-light", type == "password" ? "h-[40px]" : "h-[36px]" )} + name={name} + autoComplete={autocomplete} type={type == "password" ? (visible ? "text" : "password") : type} placeholder={placeholder} onChange={(e) => { diff --git a/src/views/home/auth/Login.tsx b/src/views/home/auth/Login.tsx index 697ea8a..6013949 100644 --- a/src/views/home/auth/Login.tsx +++ b/src/views/home/auth/Login.tsx @@ -58,8 +58,8 @@ const Login = () => { - {setUsername(v)}} placeholder="login"/> - {setPassword(v)}} placeholder="abCD1234" /> + {setUsername(v)}} placeholder="login"/> + {setPassword(v)}} placeholder="abCD1234" />
{
- {setEmail(v)}} placeholder="example@gmail.com" /> - {setUsername(v)}} placeholder="login" /> - {setPassword(v)}} placeholder="abCD1234" /> - {setConfirmPassword(v)}} placeholder="abCD1234" /> + {setEmail(v)}} placeholder="example@gmail.com" /> + {setUsername(v)}} placeholder="login" /> + {setPassword(v)}} placeholder="abCD1234" /> + {setConfirmPassword(v)}} placeholder="abCD1234" />