Skip to content

Commit

Permalink
fix(input): remove useless container
Browse files Browse the repository at this point in the history
  • Loading branch information
bramvanhoutte committed May 23, 2020
1 parent 93f3105 commit 3fc4073
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
5 changes: 1 addition & 4 deletions src/components/Input/Input.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.container {
width: 100%;
}

.input {
font: inherit;
box-sizing: border-box;
Expand All @@ -10,6 +6,7 @@
border-radius: var(--border-radius-small);
border: 1px solid var(--color-neutral-4);
padding: 6.5px 14px;
width: 100%;
}

.input::placeholder {
Expand Down
35 changes: 17 additions & 18 deletions src/components/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,26 @@ const Input = React.forwardRef<HTMLInputElement, Props>(
}: Props,
ref,
) => {
const mergedContainerClassName = classNames(cssReset.ventura, styles.container, className);
const mergedInputClassName = classNames(styles.input, {
const inputClassNames = classNames(cssReset.ventura, styles.input, {
[styles.containsError]: Boolean(isInvalid),
className,
});

return (
<div className={mergedContainerClassName} data-testid="container">
<input
name={name}
value={value}
onChange={onChange}
placeholder={placeholder}
type={type}
spellCheck={spellCheck}
autoComplete={autoComplete ? 'on' : 'off'}
maxLength={maxLength}
ref={ref}
className={mergedInputClassName}
data-testid={`input-${name}`}
onBlur={onBlur}
/>
</div>
<input
name={name}
value={value}
onChange={onChange}
placeholder={placeholder}
type={type}
spellCheck={spellCheck}
autoComplete={autoComplete ? 'on' : 'off'}
maxLength={maxLength}
ref={ref}
className={inputClassNames}
data-testid={`input-${name}`}
onBlur={onBlur}
/>
);
},
);
Expand Down

0 comments on commit 3fc4073

Please sign in to comment.