Add option to add an input label

pull/8/head
Vasek Mlejnsky 6 years ago
parent 797b66d9d5
commit a8d3fccfa7

@ -57,6 +57,11 @@ const Wrapper = styled.div`
const InputWrapper = styled.div``;
const InputLabel = styled.span`
padding-bottom: 4px;
color: ${colors.TEXT_SECONDARY};
`;
const ErrorLabel = styled.span`
margin-top: 10px;
font-size: ${FONT_SIZE.SMALLER};
@ -69,9 +74,23 @@ const StyledIcon = styled(Icon)`
`;
const Input = ({
type, autoComplete, autoCorrect, autoCapitalize, spellCheck, value, onChange, isSuccess, isWarning, isError, errorText,
type,
autoComplete,
autoCorrect,
autoCapitalize,
spellCheck,
value,
onChange,
isSuccess,
isWarning,
isError,
errorText,
inputLabel,
}) => (
<Wrapper>
{inputLabel && (
<InputLabel>{inputLabel}</InputLabel>
)}
<InputWrapper>
<StyledInput
type={type}
@ -124,6 +143,7 @@ Input.propTypes = {
isWarning: PropTypes.bool,
isError: PropTypes.bool,
errorText: PropTypes.string,
inputLabel: PropTypes.string,
};
export default Input;

Loading…
Cancel
Save