Update input component

This commit is contained in:
Hazem Krimi
2021-06-16 00:41:50 +01:00
parent 4325bf309a
commit 3d5c8d2e61
+3 -1
View File
@@ -20,6 +20,7 @@ type InputProps = {
label?: string;
name?: string;
type?: 'text' | 'email' | 'tel' | 'password' | 'file' | 'number';
file?: boolean;
placeholder?: string;
fullWidth?: boolean;
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
@@ -28,6 +29,7 @@ type InputProps = {
const Input = ({
type = 'text',
file = false,
color = 'client',
label,
name,
@@ -66,7 +68,7 @@ const Input = ({
onChange={onChange}
onBlur={onBlur}
name={name}
accept={type === 'file' ? 'image/*' : undefined}
accept={type === 'file' && !file ? 'image/*' : undefined}
placeholder={placeholder}
/>
</div>