mirror of
https://github.com/trezor/trezor-wallet
synced 2025-02-22 21:12:04 +00:00
Add option to add an input label
This commit is contained in:
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…
Reference in New Issue
Block a user