2017-06-20 06:14:23 +00:00
|
|
|
import React, { Component } from 'react';
|
2017-05-30 20:36:52 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2017-04-18 23:01:25 +00:00
|
|
|
|
2017-07-16 21:02:13 +00:00
|
|
|
export default class PasswordInput extends Component {
|
2017-06-20 06:14:23 +00:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
}
|
2017-04-18 23:01:25 +00:00
|
|
|
|
2017-06-20 06:14:23 +00:00
|
|
|
static propTypes = {
|
2017-06-20 06:28:22 +00:00
|
|
|
showPasswordGenerateWallet: PropTypes.func,
|
2017-06-20 06:14:23 +00:00
|
|
|
showPassword: PropTypes.bool,
|
|
|
|
input: PropTypes.object,
|
|
|
|
meta: PropTypes.object
|
|
|
|
};
|
2017-04-18 23:01:25 +00:00
|
|
|
|
2017-06-20 06:14:23 +00:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<div className="input-group" style={{ width: '100%' }}>
|
|
|
|
<input
|
|
|
|
{...this.props.input}
|
|
|
|
name="password"
|
|
|
|
className={
|
|
|
|
this.props.meta.error
|
|
|
|
? 'form-control is-invalid'
|
|
|
|
: 'form-control'
|
|
|
|
}
|
|
|
|
type={this.props.showPassword ? 'text' : 'password'}
|
|
|
|
placeholder="Do NOT forget to save this!"
|
|
|
|
aria-label="Enter a strong password (at least 9 characters)"
|
|
|
|
/>
|
|
|
|
<span
|
2017-07-16 21:02:13 +00:00
|
|
|
onClick={this.props.showPasswordGenerateWallet}
|
2017-06-20 06:14:23 +00:00
|
|
|
aria-label="make password visible"
|
|
|
|
role="button"
|
|
|
|
className="input-group-addon eye"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2017-04-18 23:01:25 +00:00
|
|
|
}
|