change props name in input

This commit is contained in:
Alihaghighattalab
2024-08-05 17:59:51 +03:30
parent c006f12c17
commit 03fa343f03
3 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -7,10 +7,10 @@ type Props = {
type?: React.HTMLInputTypeAttribute,
placeholder: string,
icon?: React.ReactNode,
other?: any
field?: any
}
export const Input: FC<Props> = ({ placeholder, type = "text", icon, other }) => {
export const Input: FC<Props> = ({ placeholder, type = "text", icon, field }) => {
const [hidden, setHidden] = useState<boolean>(false)
const handleHidden = () => setHidden(prev => !prev)
return (
@@ -20,7 +20,7 @@ export const Input: FC<Props> = ({ placeholder, type = "text", icon, other }) =>
!hidden ? <Eye size="23" color="#777577" onClick={handleHidden} /> : <EyeSlash size="23" color="#777577" onClick={handleHidden} />
: icon}
</div>
<InputComponent {...other} type={type === "password" && hidden ? "text" : type} placeholder={placeholder} className="input-style" />
<InputComponent {...field} type={type === "password" && hidden ? "text" : type} placeholder={placeholder} className="input-style" />
</div>
)
}