1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-30 19:00:53 +00:00

Fixed props in input and textarea

This commit is contained in:
Vladimir Volek 2018-11-22 17:15:07 +01:00
parent d62a914824
commit ea3ad58d48
4 changed files with 13 additions and 8 deletions

View File

@ -155,10 +155,10 @@ const TextArea = ({
topLabel, topLabel,
rows, rows,
maxRows, maxRows,
autoSelect,
state = '', state = '',
bottomText = '', bottomText = '',
trezorAction = null, trezorAction = null,
...rest
}) => ( }) => (
<Wrapper className={className}> <Wrapper className={className}>
{topLabel && ( {topLabel && (
@ -177,9 +177,9 @@ const TextArea = ({
onFocus={onFocus} onFocus={onFocus}
onBlur={onBlur} onBlur={onBlur}
value={value} value={value}
onClick={autoSelect ? event => event.target.select() : null}
placeholder={placeholder} placeholder={placeholder}
onChange={onChange} onChange={onChange}
{... rest}
/> />
<TrezorAction action={trezorAction}> <TrezorAction action={trezorAction}>
<ArrowUp />{trezorAction} <ArrowUp />{trezorAction}
@ -208,6 +208,7 @@ TextArea.propTypes = {
isDisabled: PropTypes.bool, isDisabled: PropTypes.bool,
topLabel: PropTypes.node, topLabel: PropTypes.node,
state: PropTypes.string, state: PropTypes.string,
autoSelect: PropTypes.bool,
bottomText: PropTypes.string, bottomText: PropTypes.string,
trezorAction: PropTypes.node, trezorAction: PropTypes.node,
}; };

View File

@ -173,6 +173,7 @@ class Input extends PureComponent {
{this.props.icon} {this.props.icon}
<StyledInput <StyledInput
autoComplete="off" autoComplete="off"
height={this.props.height}
trezorAction={this.props.trezorAction} trezorAction={this.props.trezorAction}
hasIcon={this.getIcon(this.props.state).length > 0} hasIcon={this.getIcon(this.props.state).length > 0}
innerRef={this.props.innerRef} innerRef={this.props.innerRef}
@ -180,8 +181,8 @@ class Input extends PureComponent {
type={this.props.type} type={this.props.type}
color={this.getColor(this.props.state)} color={this.getColor(this.props.state)}
placeholder={this.props.placeholder} placeholder={this.props.placeholder}
autocorrect={this.props.autocorrect} autoCorrect={this.props.autocorrect}
autocapitalize={this.props.autocapitalize} autoCapitalize={this.props.autocapitalize}
spellCheck={this.props.spellCheck} spellCheck={this.props.spellCheck}
isSmallText={this.props.isSmallText} isSmallText={this.props.isSmallText}
value={this.props.value} value={this.props.value}
@ -216,7 +217,7 @@ Input.propTypes = {
innerRef: PropTypes.func, innerRef: PropTypes.func,
placeholder: PropTypes.string, placeholder: PropTypes.string,
type: PropTypes.string, type: PropTypes.string,
autocomplete: PropTypes.string, height: PropTypes.number,
autocorrect: PropTypes.string, autocorrect: PropTypes.string,
autocapitalize: PropTypes.string, autocapitalize: PropTypes.string,
icon: PropTypes.node, icon: PropTypes.node,
@ -239,7 +240,7 @@ Input.propTypes = {
Input.defaultProps = { Input.defaultProps = {
type: 'text', type: 'text',
autoSelect: false, autoSelect: false,
autocomplete: 'off', height: 40,
}; };
export default Input; export default Input;

View File

@ -58,7 +58,7 @@ const Content = ({
); );
Content.propTypes = { Content.propTypes = {
children: PropTypes.element, children: PropTypes.oneOfType([PropTypes.element, PropTypes.array]),
isLoading: PropTypes.bool, isLoading: PropTypes.bool,
title: PropTypes.string, title: PropTypes.string,
message: PropTypes.string, message: PropTypes.string,

View File

@ -80,9 +80,9 @@ class SignVerify extends Component <Props, SignVerifyState> {
topLabel="Address" topLabel="Address"
name="signAddress" name="signAddress"
value={account.address} value={account.address}
height={50}
type="text" type="text"
isSmallText isSmallText
autoSelect
isDisabled isDisabled
/> />
</Row> </Row>
@ -103,6 +103,7 @@ class SignVerify extends Component <Props, SignVerifyState> {
name="signSignature" name="signSignature"
value={signSignature} value={signSignature}
rows={4} rows={4}
autoSelect
maxRows={4} maxRows={4}
maxLength="255" maxLength="255"
isDisabled isDisabled
@ -124,6 +125,7 @@ class SignVerify extends Component <Props, SignVerifyState> {
<Row> <Row>
<Input <Input
topLabel="Address" topLabel="Address"
autoSelect
name="verifyAddress" name="verifyAddress"
value={verifyAddress} value={verifyAddress}
onChange={this.handleInputChange} onChange={this.handleInputChange}
@ -147,6 +149,7 @@ class SignVerify extends Component <Props, SignVerifyState> {
<Row> <Row>
<Textarea <Textarea
topLabel="Signature" topLabel="Signature"
autoSelect
name="verifySignature" name="verifySignature"
value={verifySignature} value={verifySignature}
onChange={this.handleInputChange} onChange={this.handleInputChange}