2017-05-30 20:36:52 +00:00
|
|
|
import React, {Component} from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2017-04-18 23:01:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
export default class GenerateWalletPasswordInputComponent extends Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props)
|
|
|
|
}
|
|
|
|
|
|
|
|
static propTypes = {
|
2017-06-20 03:15:38 +00:00
|
|
|
SHOW_GENERATE_WALLET_PASSWORD_ACTION: PropTypes.func,
|
2017-04-18 23:01:25 +00:00
|
|
|
showPassword: PropTypes.bool,
|
|
|
|
input: PropTypes.object,
|
|
|
|
meta: PropTypes.object
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<div className="input-group" style={{width: '100%'}}>
|
|
|
|
<input {...this.props.input}
|
|
|
|
name="password"
|
2017-05-30 20:36:52 +00:00
|
|
|
className={this.props.meta.error ? 'form-control is-invalid' : 'form-control'}
|
2017-04-18 23:01:25 +00:00
|
|
|
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-06-20 03:15:38 +00:00
|
|
|
onClick={() => this.props.SHOW_GENERATE_WALLET_PASSWORD_ACTION()}
|
2017-04-18 23:01:25 +00:00
|
|
|
aria-label="make password visible"
|
|
|
|
role="button"
|
|
|
|
className="input-group-addon eye"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|