Login component working

This commit is contained in:
John Lyon-Smith
2018-02-27 14:44:37 -08:00
parent 73b5cf6caa
commit c79df7722b
25 changed files with 112 additions and 321 deletions

View File

@@ -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} />
)
}
}