Skip to content

Commit

Permalink
Custom Text Input
Browse files Browse the repository at this point in the history
  • Loading branch information
SansCaar committed Jul 19, 2024
1 parent 610e0c8 commit 87f8825
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions nepalingo-web/src/components/CustomTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
interface TextInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
label?: string;
value?: string;
onChangeText?: (text: string) => void;
iconProps: FontAwesomeIconProps;
placeholder?: string;
error?: string;
Expand All @@ -17,14 +16,14 @@ interface TextInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
}
export const CustomTextInput = ({
label,
onChangeText,
iconProps,
placeholder,
name,
inputType,
className,
error,

Check failure on line 24 in nepalingo-web/src/components/CustomTextInput.tsx

View workflow job for this annotation

GitHub Actions / test_build

'error' is defined but never used
...props
}: TextInputProps) => {
const inputRef = useRef<null | HTMLInputElement>(null);
return (
<div className={className}>
{label && (
Expand All @@ -38,13 +37,12 @@ export const CustomTextInput = ({
<div className="relative mb-6 w-full">
<FontAwesomeIcon {...iconProps} />
<input
ref={inputRef}
type={inputType}
name={name}
className={`p-4 ${iconProps ? "ps-12" : ""
} bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white focus:outline-primary `}
placeholder={placeholder}
onChange={(e) => onChangeText && onChangeText(e.target.value)}
{...props}
/>
</div>
</div>
Expand Down

0 comments on commit 87f8825

Please sign in to comment.