Update input component

This commit is contained in:
Hazem Krimi
2021-04-28 21:30:50 +01:00
parent f49b38dddd
commit 63a5715b99
2 changed files with 27 additions and 0 deletions
+3
View File
@@ -23,6 +23,7 @@ type InputProps = {
placeholder?: string;
fullWidth?: boolean;
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
};
const Input = ({
@@ -33,6 +34,7 @@ const Input = ({
placeholder,
value,
onChange,
onBlur,
error,
errorMessage,
...props
@@ -62,6 +64,7 @@ const Input = ({
type={type}
value={value}
onChange={onChange}
onBlur={onBlur}
name={name}
accept={type === 'file' ? 'image/*' : undefined}
placeholder={placeholder}
+24
View File
@@ -98,6 +98,10 @@ export const Wrapper = styled.div<WrapperProps>`
return css`
.input {
background: ${theme.colors.client.light};
&:focus-within {
background: ${theme.colors.client.main};
}
}
input[type='file'] {
@@ -112,6 +116,10 @@ export const Wrapper = styled.div<WrapperProps>`
return css`
.input {
background: ${theme.colors.productOwner.light};
&:focus-within {
background: ${theme.colors.productOwner.main};
}
}
input[type='file'] {
@@ -126,6 +134,10 @@ export const Wrapper = styled.div<WrapperProps>`
return css`
.input {
background: ${theme.colors.developer.light};
&:focus-within {
background: ${theme.colors.developer.main};
}
}
input[type='file'] {
@@ -140,6 +152,10 @@ export const Wrapper = styled.div<WrapperProps>`
return css`
.input {
background: ${theme.colors.admin.light};
&:focus-within {
background: ${theme.colors.admin.main};
}
}
input[type='file'] {
@@ -224,6 +240,10 @@ export const Wrapper = styled.div<WrapperProps>`
return css`
.input {
background: ${theme.colors.client.light};
&:focus-within {
background: ${theme.colors.client.main};
}
}
input[type='file'] {
@@ -248,6 +268,10 @@ export const Wrapper = styled.div<WrapperProps>`
.input {
background: ${theme.colors.error.main};
&:focus-within {
background: ${theme.colors.error.main};
}
}
input[type='file'] {