Login component working
This commit is contained in:
@@ -6,17 +6,22 @@ import style from './Input.style'
|
||||
class Input extends Component {
|
||||
static propTypes = {
|
||||
password: PropTypes.bool,
|
||||
children: PropTypes.node,
|
||||
width: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ])
|
||||
placeholder: PropTypes.string,
|
||||
width: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),
|
||||
onChange: PropTypes.func,
|
||||
visible: PropTypes.bool,
|
||||
disabled: PropTypes.bool,
|
||||
name: PropTypes.string,
|
||||
}
|
||||
|
||||
render() {
|
||||
let { children, width } = this.props
|
||||
let { name, width, password, placeholder, onChange, visible, disabled } = this.props
|
||||
|
||||
width = width || '100%'
|
||||
|
||||
return (
|
||||
<input type={this.props.password ? 'password' : 'text'} style={[ { width }, style.base ]}>{children}</input>
|
||||
<input name={name} type={!visible ? 'hidden' : password ? 'password' : 'text'} disabled={disabled}
|
||||
style={[ { width }, style.base ]} placeholder={placeholder} onChange={onChange} />
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user