From a8d3fccfa77b9124714008cc7c07b011306f11ee Mon Sep 17 00:00:00 2001 From: Vasek Mlejnsky Date: Thu, 30 Aug 2018 15:33:38 +0200 Subject: [PATCH] Add option to add an input label --- src/components/Input/index.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/components/Input/index.js b/src/components/Input/index.js index b6855ef4..7994d0c6 100644 --- a/src/components/Input/index.js +++ b/src/components/Input/index.js @@ -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, }) => ( + {inputLabel && ( + {inputLabel} + )}