chore: migrated to using custom Input component to address redundant twClasses

This commit is contained in:
utin-francis-peter
2024-07-03 12:34:13 +01:00
parent 0a533b64e1
commit b21230c4d6
6 changed files with 87 additions and 38 deletions

View File

@@ -0,0 +1,39 @@
import { InputProps } from './types';
const Input = ({
id,
name,
type,
value,
isAutoFocused = false,
placeholder,
maxLength,
className,
hasSilverBorder,
children,
onChange,
onPaste,
onKeyDown,
}: InputProps) => {
return (
<input
className={`h-[42px] w-full rounded-full border-2 px-3 outline-none dark:bg-transparent dark:text-white ${
hasSilverBorder ? 'border-silver dark:border-silver/40' : ''
} ${className}`}
type={type}
id={id}
name={name}
autoFocus={isAutoFocused}
placeholder={placeholder}
maxLength={maxLength}
value={value}
onChange={onChange}
onPaste={onPaste}
onKeyDown={onKeyDown}
>
{children}
</input>
);
};
export default Input;