autocomplete
This commit is contained in:
@@ -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<inputProps> = ({
|
||||
@@ -24,6 +26,8 @@ export const Input: React.FC<inputProps> = ({
|
||||
className = "",
|
||||
onChange,
|
||||
defaultState = "",
|
||||
name = "",
|
||||
autocomplete="",
|
||||
}) => {
|
||||
const [value, setValue] = React.useState<string>(defaultState);
|
||||
const [visible, setVIsible] = React.useState<boolean>(type != "password");
|
||||
@@ -47,6 +51,8 @@ export const Input: React.FC<inputProps> = ({
|
||||
"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) => {
|
||||
|
||||
Reference in New Issue
Block a user