Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
fix(Input): Remove height from InputContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
kylealwyn committed Jul 13, 2018
1 parent 950d2ee commit e26c0de
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"docs": "yarn docz dev",
"docs:build": "rimraf dist && yarn docz build",
"docs:deploy": "npm run docs:build && gh-pages -d dist",
"prepublishOnly": "npm-run-all docs:deploy build",
"prepublishOnly": "npm-run-all build",
"rollup": "rollup -c",
"test": "jest",
"lint": "eslint src",
Expand Down
13 changes: 5 additions & 8 deletions src/Form/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ import { createComponent } from '../utils';
const InputContainer = createComponent({
name: 'InputContainer',
}).extend`
${({ theme, size }) => css`
position: relative;
height: ${theme.heights[size]}px;
`}
position: relative;
`;

const StyledInput = createComponent({
name: 'Input',
tag: 'input',
}).extend`
${({ isFloating, isFloatable, size, theme, borderRadius = theme.radius }) => css`
${({ isFloating, size, theme, borderRadius = theme.radius }) => css`
border: 1px solid ${theme.colors.grayLight};
height: ${theme.heights[size]}px;
display: block;
Expand Down Expand Up @@ -234,16 +231,16 @@ export default class Input extends React.Component {
);

return (
<Field>
<Field styles={rest.styles}>
{!floating && Label}

<InputContainer styles={rest.styles} size={size} isFloatable={floating}>
<InputContainer styles={rest.styles}>
{floating && Label}

{multiline ? <StyledTextArea {...inputProps} /> : <StyledInput {...inputProps} />}
</InputContainer>

{!this.state.focused && error ? <FormError>{error}</FormError> : null}
{!this.state.focused && error ? <FormError styles={rest.styles}>{error}</FormError> : null}
</Field>
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ export default (passedTheme = {}) => {
};

const heights = {
xs: 20,
sm: 28,
md: 32,
xs: 28,
sm: 32,
md: 36,
lg: 40,
xl: 44,
};
Expand Down

0 comments on commit e26c0de

Please sign in to comment.