mirror of
https://github.com/trezor/trezor-wallet
synced 2025-02-23 13:32:02 +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 InputWrapper = styled.div``;
|
||||||
|
|
||||||
|
const InputLabel = styled.span`
|
||||||
|
padding-bottom: 4px;
|
||||||
|
color: ${colors.TEXT_SECONDARY};
|
||||||
|
`;
|
||||||
|
|
||||||
const ErrorLabel = styled.span`
|
const ErrorLabel = styled.span`
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
font-size: ${FONT_SIZE.SMALLER};
|
font-size: ${FONT_SIZE.SMALLER};
|
||||||
@ -69,9 +74,23 @@ const StyledIcon = styled(Icon)`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const Input = ({
|
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>
|
<Wrapper>
|
||||||
|
{inputLabel && (
|
||||||
|
<InputLabel>{inputLabel}</InputLabel>
|
||||||
|
)}
|
||||||
<InputWrapper>
|
<InputWrapper>
|
||||||
<StyledInput
|
<StyledInput
|
||||||
type={type}
|
type={type}
|
||||||
@ -124,6 +143,7 @@ Input.propTypes = {
|
|||||||
isWarning: PropTypes.bool,
|
isWarning: PropTypes.bool,
|
||||||
isError: PropTypes.bool,
|
isError: PropTypes.bool,
|
||||||
errorText: PropTypes.string,
|
errorText: PropTypes.string,
|
||||||
|
inputLabel: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Input;
|
export default Input;
|
||||||
|
Loading…
Reference in New Issue
Block a user